From 922e0fb6de06a98774418612e0b0f75af72b6dbb Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 25 Jun 2016 14:34:46 -0400 Subject: Rewrite integration tests to run with Docker containers --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 6f523373..aa9eb9cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,8 +24,7 @@ COPY .docker/php/conf.d/local.ini /etc/php5/conf.d/ COPY .docker/php/php-fpm.conf /etc/php5/ COPY .docker/nginx/nginx.conf /etc/nginx/ COPY .docker/kanboard/config.php /var/www/kanboard/ -COPY .docker/kanboard/config.php /var/www/kanboard/ -COPY .docker/crontab/kanboard /var/spool/cron/crontabs/nginx +COPY .docker/crontab/cronjob.alpine /var/spool/cron/crontabs/nginx EXPOSE 80 -- cgit v1.2.3 From 4b5c3b05271a63cb7b2790ffa9a81453fef5b642 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 2 Jul 2016 22:35:54 -0400 Subject: Use PHP7 for Docker image --- .docker/crontab/cronjob.alpine | 1 - .docker/crontab/cronjob.debian | 1 - .docker/kanboard/config.php | 3 -- .docker/nginx/nginx.conf | 72 ------------------------------------ .docker/php/conf.d/local.ini | 16 -------- .docker/php/php-fpm.conf | 22 ----------- .docker/services.d/.s6-svscan/finish | 2 - .docker/services.d/cron/run | 2 - .docker/services.d/nginx/run | 2 - .docker/services.d/php/run | 2 - .dockerignore | 18 ++++++++- ChangeLog | 1 + Dockerfile | 37 ++++-------------- Makefile | 3 +- app/constants.php | 2 +- doc/docker.markdown | 6 +-- doc/env.markdown | 1 - docker/crontab/cronjob.alpine | 1 + docker/php/env.conf | 2 + docker/services.d/cron/run | 2 + 20 files changed, 36 insertions(+), 160 deletions(-) delete mode 100644 .docker/crontab/cronjob.alpine delete mode 100644 .docker/crontab/cronjob.debian delete mode 100644 .docker/kanboard/config.php delete mode 100644 .docker/nginx/nginx.conf delete mode 100644 .docker/php/conf.d/local.ini delete mode 100644 .docker/php/php-fpm.conf delete mode 100755 .docker/services.d/.s6-svscan/finish delete mode 100755 .docker/services.d/cron/run delete mode 100755 .docker/services.d/nginx/run delete mode 100755 .docker/services.d/php/run create mode 100644 docker/crontab/cronjob.alpine create mode 100644 docker/php/env.conf create mode 100755 docker/services.d/cron/run (limited to 'Dockerfile') diff --git a/.docker/crontab/cronjob.alpine b/.docker/crontab/cronjob.alpine deleted file mode 100644 index 91ad044e..00000000 --- a/.docker/crontab/cronjob.alpine +++ /dev/null @@ -1 +0,0 @@ -1 0 * * * cd /var/www/kanboard && ./kanboard cronjob >/dev/null 2>&1 diff --git a/.docker/crontab/cronjob.debian b/.docker/crontab/cronjob.debian deleted file mode 100644 index 40310d4f..00000000 --- a/.docker/crontab/cronjob.debian +++ /dev/null @@ -1 +0,0 @@ -@daily www-data cd /var/www/html/kanboard && ./kanboard cronjob >/dev/null 2>&1 diff --git a/.docker/kanboard/config.php b/.docker/kanboard/config.php deleted file mode 100644 index fa1c5971..00000000 --- a/.docker/kanboard/config.php +++ /dev/null @@ -1,3 +0,0 @@ - +FROM fguillot/alpine-nginx-php7 -RUN apk update && \ - apk add nginx bash ca-certificates s6 curl \ - php5-fpm php5-json php5-zlib php5-xml php5-dom php5-ctype php5-opcache php5-zip \ - php5-pdo php5-pdo_mysql php5-pdo_sqlite php5-pdo_pgsql php5-ldap \ - php5-gd php5-mcrypt php5-openssl php5-phar && \ - rm -rf /var/cache/apk/* +COPY . /var/www/app +COPY docker/kanboard/config.php /var/www/app/config.php +COPY docker/crontab/cronjob.alpine /var/spool/cron/crontabs/nginx +COPY docker/services.d/cron /etc/services.d/cron -RUN curl -sS https://getcomposer.org/installer | php -- --filename=/usr/local/bin/composer - -RUN cd /var/www \ - && curl -LO https://github.com/fguillot/kanboard/archive/master.zip \ - && unzip -qq master.zip \ - && rm -f *.zip \ - && mv kanboard-master kanboard \ - && cd /var/www/kanboard && composer --prefer-dist --no-dev --optimize-autoloader --quiet install \ - && chown -R nginx:nginx /var/www/kanboard \ - && chown -R nginx:nginx /var/lib/nginx - -COPY .docker/services.d /etc/services.d -COPY .docker/php/conf.d/local.ini /etc/php5/conf.d/ -COPY .docker/php/php-fpm.conf /etc/php5/ -COPY .docker/nginx/nginx.conf /etc/nginx/ -COPY .docker/kanboard/config.php /var/www/kanboard/ -COPY .docker/crontab/cronjob.alpine /var/spool/cron/crontabs/nginx - -EXPOSE 80 +RUN cd /var/www/app && composer --prefer-dist --no-dev --optimize-autoloader --quiet install +RUN chown -R nginx:nginx /var/www/app/data /var/www/app/plugins VOLUME /var/www/kanboard/data VOLUME /var/www/kanboard/plugins - -ENTRYPOINT ["/bin/s6-svscan", "/etc/services.d"] -CMD [] diff --git a/Makefile b/Makefile index 47e9d389..4595481d 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,8 @@ archive: @ rm -rf ${BUILD_DIR}/kanboard/*.lock @ rm -rf ${BUILD_DIR}/kanboard/*.json @ rm -rf ${BUILD_DIR}/kanboard/*.js - @ rm -rf ${BUILD_DIR}/kanboard/.docker + @ rm -rf ${BUILD_DIR}/kanboard/.dockerignore + @ rm -rf ${BUILD_DIR}/kanboard/docker @ rm -rf ${BUILD_DIR}/kanboard/nitrous* @ cd ${BUILD_DIR}/kanboard && find ./vendor -name doc -type d -exec rm -rf {} +; @ cd ${BUILD_DIR}/kanboard && find ./vendor -name notes -type d -exec rm -rf {} +; diff --git a/app/constants.php b/app/constants.php index 604f6acd..fc120692 100644 --- a/app/constants.php +++ b/app/constants.php @@ -21,7 +21,7 @@ defined('PLUGIN_INSTALLER') or define('PLUGIN_INSTALLER', true); defined('DEBUG') or define('DEBUG', strtolower(getenv('DEBUG')) === 'true'); // Logging drivers: syslog, stdout, stderr or file -defined('LOG_DRIVER') or define('LOG_DRIVER', getenv('LOG_DRIVER')); +defined('LOG_DRIVER') or define('LOG_DRIVER', ''); // Logging file defined('LOG_FILE') or define('LOG_FILE', DATA_DIR.DIRECTORY_SEPARATOR.'debug.log'); diff --git a/doc/docker.markdown b/doc/docker.markdown index 3f13e954..9af5f57a 100644 --- a/doc/docker.markdown +++ b/doc/docker.markdown @@ -3,17 +3,17 @@ How to run Kanboard with Docker? Kanboard can run easily with [Docker](https://www.docker.com). -The image size is approximately **50MB** and contains: +The image size is approximately **70MB** and contains: - [Alpine Linux](http://alpinelinux.org/) - The [process manager S6](http://skarnet.org/software/s6/) - Nginx -- PHP-FPM +- PHP 7 The Kanboard cronjob is also running everyday at midnight. URL rewriting is enabled in the included config file. -When the container is running, the memory utilization is around **20MB**. +When the container is running, the memory utilization is around **30MB**. Use the stable version ---------------------- diff --git a/doc/env.markdown b/doc/env.markdown index 28f14b18..902066d7 100644 --- a/doc/env.markdown +++ b/doc/env.markdown @@ -7,4 +7,3 @@ Environment variables maybe useful when Kanboard is deployed as container (Docke |---------------|---------------------------------------------------------------------------------------------------------------------------------| | DATABASE_URL | `[database type]://[username]:[password]@[host]:[port]/[database name]`, example: `postgres://foo:foo@myserver:5432/kanboard` | | DEBUG | Enable/Disable debug mode: "true" or "false" | -| LOG_DRIVER | Logging driver: stdout, stderr, file or syslog | diff --git a/docker/crontab/cronjob.alpine b/docker/crontab/cronjob.alpine new file mode 100644 index 00000000..d051ff28 --- /dev/null +++ b/docker/crontab/cronjob.alpine @@ -0,0 +1 @@ +1 0 * * * cd /var/www/app && ./kanboard cronjob diff --git a/docker/php/env.conf b/docker/php/env.conf new file mode 100644 index 00000000..bcf2e37c --- /dev/null +++ b/docker/php/env.conf @@ -0,0 +1,2 @@ +env[DATABASE_URL] = $DATABASE_URL +env[DEBUG] = $DEBUG diff --git a/docker/services.d/cron/run b/docker/services.d/cron/run new file mode 100755 index 00000000..da378099 --- /dev/null +++ b/docker/services.d/cron/run @@ -0,0 +1,2 @@ +#!/bin/execlineb -P +crond -f \ No newline at end of file -- cgit v1.2.3 From e7a15de9e51973c1ed17ccdd01f7d24b5c3530a5 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 2 Jul 2016 22:52:52 -0400 Subject: Docker volume path --- Dockerfile | 4 ++-- doc/docker.markdown | 8 ++++---- docker-compose.yml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index ebc87238..518f4685 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,5 +8,5 @@ COPY docker/services.d/cron /etc/services.d/cron RUN cd /var/www/app && composer --prefer-dist --no-dev --optimize-autoloader --quiet install RUN chown -R nginx:nginx /var/www/app/data /var/www/app/plugins -VOLUME /var/www/kanboard/data -VOLUME /var/www/kanboard/plugins +VOLUME /var/www/app/data +VOLUME /var/www/app/plugins diff --git a/doc/docker.markdown b/doc/docker.markdown index 9af5f57a..e55130e5 100644 --- a/doc/docker.markdown +++ b/doc/docker.markdown @@ -64,8 +64,8 @@ Volumes You can attach 2 volumes to your container: -- Data folder: `/var/www/kanboard/data` -- Plugins folder: `/var/www/kanboard/plugins` +- Data folder: `/var/www/app/data` +- Plugins folder: `/var/www/app/plugins` Use the flag `-v` to mount a volume on the host machine like described in [official Docker documentation](https://docs.docker.com/engine/userguide/containers/dockervolumes/). @@ -84,8 +84,8 @@ The list of environment variables is available on [this page](env.markdown). Config files ------------ -- The container already include a custom config file located at `/var/www/kanboard/config.php`. -- You can store your own config file on the data volume: `/var/www/kanboard/data/config.php`. +- The container already include a custom config file located at `/var/www/app/config.php`. +- You can store your own config file on the data volume: `/var/www/app/data/config.php`. References ---------- diff --git a/docker-compose.yml b/docker-compose.yml index aa0a6710..9b618cf6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,8 +5,8 @@ services: ports: - "80:80" volumes: - - kanboard_data:/var/www/kanboard/data - - kanboard_plugins:/var/www/kanboard/plugins + - kanboard_data:/var/www/app/data + - kanboard_plugins:/var/www/app/plugins volumes: kanboard_data: driver: local -- cgit v1.2.3 From 141939b703b4028fb85c04ba5d27445486eceb61 Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 9 Jul 2016 14:17:31 -0400 Subject: Add environment file for Docker image --- Dockerfile | 1 + 1 file changed, 1 insertion(+) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 518f4685..99e940bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ COPY . /var/www/app COPY docker/kanboard/config.php /var/www/app/config.php COPY docker/crontab/cronjob.alpine /var/spool/cron/crontabs/nginx COPY docker/services.d/cron /etc/services.d/cron +COPY docker/php/env.conf /etc/php7/php-fpm.d/env.conf RUN cd /var/www/app && composer --prefer-dist --no-dev --optimize-autoloader --quiet install RUN chown -R nginx:nginx /var/www/app/data /var/www/app/plugins -- cgit v1.2.3