Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ RUN APP_ENV=prod COMPOSER_ALLOW_SUPERUSER=1 composer install --no-ansi --no-dev
# otherwise PHP-FPM can neither write its cache nor its logs (500 on every request, and no log to tell)
RUN mkdir -p var/log var/cache && chown -R ${FPM_USER} var

COPY ./docker/configurations/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

USER $FPM_USER

HEALTHCHECK --interval=30s --timeout=1s CMD ["php-fpm-healthcheck"]

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["php-fpm"]
4 changes: 4 additions & 0 deletions docker/Dockerfile-standalone
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,14 @@ RUN mkdir /var/run/php-fpm && chown -R www-data:www-data /var/run/php-fpm \

RUN mkdir -p ./var/log ./var/cache && chown -R www-data:www-data ./var

COPY ./docker/configurations/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh

# Cleanup (only useful when using --squash)
RUN docker-php-source delete && \
rm -rf /var/www/davis/docker

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

HEALTHCHECK --interval=120s --timeout=10s --start-period=60s --retries=3 \
Expand Down
6 changes: 6 additions & 0 deletions docker/configurations/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
set -e

php bin/console doctrine:migrations:migrate --no-interaction

exec "$@"
8 changes: 7 additions & 1 deletion docker/docker-compose-postgresql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ services:
- POSTGRES_USER=${DB_USER}
volumes:
- database_pg:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5

davis:
build:
Expand All @@ -41,7 +46,8 @@ services:
- DATABASE_URL=postgresql://${DB_USER}:${DB_PASSWORD}@postgresql:5432/${DB_DATABASE}?serverVersion=15&charset=UTF-8
- MAILER_DSN=smtp://${MAIL_USERNAME}:${MAIL_PASSWORD}@${MAIL_HOST}:${MAIL_PORT}
depends_on:
- postgresql
postgresql:
condition: service_healthy
volumes:
- davis_www:/var/www/davis

Expand Down
8 changes: 7 additions & 1 deletion docker/docker-compose-standalone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ services:
- MYSQL_PASSWORD=${DB_PASSWORD}
volumes:
- database:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_ROOT_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5

davis:
build:
Expand All @@ -28,7 +33,8 @@ services:
- DATABASE_URL=mysql://${DB_USER}:${DB_PASSWORD}@mysql:3306/${DB_DATABASE}?serverVersion=mariadb-10.6.10&charset=utf8mb4
- MAILER_DSN=smtp://${MAIL_USERNAME}:${MAIL_PASSWORD}@${MAIL_HOST}:${MAIL_PORT}
depends_on:
- mysql
mysql:
condition: service_healthy
ports:
- 9000:9000

Expand Down
8 changes: 7 additions & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ services:
- MYSQL_PASSWORD=${DB_PASSWORD}
volumes:
- database:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_ROOT_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 5

davis:
build:
Expand All @@ -44,7 +49,8 @@ services:
- DATABASE_URL=mysql://${DB_USER}:${DB_PASSWORD}@mysql:3306/${DB_DATABASE}?serverVersion=mariadb-10.6.10&charset=utf8mb4
- MAILER_DSN=smtp://${MAIL_USERNAME}:${MAIL_PASSWORD}@${MAIL_HOST}:${MAIL_PORT}
depends_on:
- mysql
mysql:
condition: service_healthy
volumes:
- davis_www:/var/www/davis

Expand Down