diff --git a/.gitignore b/.gitignore index 355afad..e1f8611 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ includes/config.inc.php database/config.sql site/.htaccess +docker/.env diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..4e7b01a --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,37 @@ +# syntax=docker/dockerfile:1.7-labs +ARG PHP_VERSION=8.3 +ARG POSTGRESQL_VERSION=17 + +# +# Application image +# + +FROM php:${PHP_VERSION}-fpm-alpine AS application + +RUN <> /usr/local/etc/php-fpm.d/zz-docker.conf + echo "chdir = /var/www/tasks/site" >> /usr/local/etc/php-fpm.d/zz-docker.conf + curl --silent --remote-name https://raw.githubusercontent.com/renatomefi/php-fpm-healthcheck/v0.5.0/php-fpm-healthcheck + install --owner root --group root --mode 755 php-fpm-healthcheck /usr/local/bin/php-fpm-healthcheck + rm -rf php-fpm-healthcheck + mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" +EOF +HEALTHCHECK --interval=5s \ + CMD php-fpm-healthcheck || exit 1 + +COPY --parents site includes arse /var/www/tasks/ + +# +# Database image +# + +FROM postgres:${POSTGRESQL_VERSION} AS database +RUN mkdir /opt/tasks +COPY --parents database.sql database /opt/tasks/ diff --git a/docker/app-config.inc.php b/docker/app-config.inc.php new file mode 100644 index 0000000..2caa95e --- /dev/null +++ b/docker/app-config.inc.php @@ -0,0 +1,15 @@ +