commit bc8b826e7c487653cae5e36342cc3bc7be356b87 Author: Sebastian Hugentobler Date: Tue May 29 09:39:04 2018 +0200 Initial commit diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d741e40 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 4 diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..93bfd12 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +.DS_Store diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..dfde774 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,10 @@ +build: + image: docker:latest + services: + - docker:dind + stage: build + script: + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY + - docker build --pull --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA . + - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME + - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..82cfa23 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,45 @@ +FROM registry.gitlab.com/thallian/docker-php7-fpm:master + +ENV FPMUSER nginx +ENV FPMGROUP nginx + +ENV VERSION master + +RUN apk add --no-cache \ + libressl \ + git \ + nginx \ + wget \ + php7 \ + php7-opcache \ + php7-pcntl \ + php7-gd \ + php7-sqlite3 \ + php7-json \ + php7-intl \ + php7-xml \ + php7-mbstring \ + php7-zip \ + php7-openssl \ + php7-phar \ + php7-pdo_sqlite \ + php7-ctype \ + php7-xmlwriter \ + php7-dom + +RUN mkdir -p /usr/share/webapps/cops +RUN wget -qO- https://github.com/seblucas/cops/archive/$VERSION.tar.gz | tar xz -C /usr/share/webapps/cops --strip 1 + +WORKDIR /usr/share/webapps/cops +RUN wget https://getcomposer.org/composer.phar +RUN php composer.phar global require "fxp/composer-asset-plugin:~1.1" +RUN php composer.phar install --no-dev --optimize-autoloader + +RUN chown -R nginx:nginx /usr/share/webapps/cops + +RUN mkdir /run/nginx +RUN rm /etc/nginx/conf.d/default.conf + +ADD /rootfs / + +VOLUME /var/lib/cops/calibre diff --git a/README.md b/README.md new file mode 100644 index 0000000..c6ea0ee --- /dev/null +++ b/README.md @@ -0,0 +1,16 @@ +[COPS](https://github.com/seblucas/cops), a web-based light alternative to Calibre content server. + +# Volumes +- `/var/lib/cops/calibre` + +# Environment Variables +## DOMAIN +Domain where the cops instance is reachable. + +## TITLE +- default: COPS + +Website title. + +# Ports +- 80 diff --git a/rootfs/etc/confd/conf.d/config.local.php.toml b/rootfs/etc/confd/conf.d/config.local.php.toml new file mode 100644 index 0000000..bd0a74e --- /dev/null +++ b/rootfs/etc/confd/conf.d/config.local.php.toml @@ -0,0 +1,3 @@ +[template] +src = "config_local.php.tmpl" +dest = "/usr/share/webapps/cops/config_local.php" diff --git a/rootfs/etc/confd/conf.d/cops.conf.toml b/rootfs/etc/confd/conf.d/cops.conf.toml new file mode 100644 index 0000000..46dafa7 --- /dev/null +++ b/rootfs/etc/confd/conf.d/cops.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "cops.conf.tmpl" +dest = "/etc/nginx/conf.d/cops.conf" diff --git a/rootfs/etc/confd/templates/config_local.php.tmpl b/rootfs/etc/confd/templates/config_local.php.tmpl new file mode 100644 index 0000000..3039cf0 --- /dev/null +++ b/rootfs/etc/confd/templates/config_local.php.tmpl @@ -0,0 +1,13 @@ +