pathfinder-containers/pathfinder.Dockerfile

58 lines
2.1 KiB
Text
Raw Normal View History

FROM php:7.4.33-fpm-alpine3.16 as build
2021-09-05 13:27:54 +12:00
2020-08-30 19:59:19 +12:00
RUN apk update \
&& apk add --no-cache libpng-dev zeromq-dev git \
$PHPIZE_DEPS \
2022-08-02 00:36:56 -04:00
&& docker-php-ext-install gd && docker-php-ext-install pdo_mysql && \
pecl install redis && docker-php-ext-enable redis && \
pecl install channel://pecl.php.net/zmq-1.1.3 && docker-php-ext-enable zmq && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
2020-08-30 19:59:19 +12:00
COPY pathfinder /app
WORKDIR /app
2021-07-27 15:20:52 +12:00
2021-09-18 16:31:22 +12:00
RUN composer self-update 2.1.8
2020-08-30 19:59:19 +12:00
RUN composer install
FROM trafex/alpine-nginx-php7:ba1dd422
RUN apk update && apk add --no-cache busybox-suid sudo php7-redis php7-pdo php7-pdo_mysql \
php7-fileinfo php7-event shadow gettext bash apache2-utils logrotate ca-certificates
# fix expired DST Cert
RUN sed -i '/^mozilla\/DST_Root_CA_X3.crt$/ s/^/!/' /etc/ca-certificates.conf \
&& update-ca-certificates
# symlink nginx logs to stdout/stderr for supervisord
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
2020-08-30 19:59:19 +12:00
COPY static/logrotate/pathfinder /etc/logrotate.d/pathfinder
2020-08-30 19:59:19 +12:00
COPY static/nginx/nginx.conf /etc/nginx/templateNginx.conf
2021-10-25 18:30:37 +13:00
# we need to create sites_enabled directory in order for entrypoint.sh being able to copy file after envsubst
RUN mkdir -p /etc/nginx/sites_enabled/
COPY static/nginx/site.conf /etc/nginx/templateSite.conf
2020-08-30 19:59:19 +12:00
# Configure PHP-FPM
COPY static/php/fpm-pool.conf /etc/php7/php-fpm.d/zzz_custom.conf
2021-07-27 15:20:52 +12:00
2020-08-30 19:59:19 +12:00
COPY static/php/php.ini /etc/zzz_custom.ini
# configure cron
COPY static/crontab.txt /var/crontab.txt
# Configure supervisord
COPY static/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY static/entrypoint.sh /
2021-09-05 13:27:54 +12:00
2020-08-30 19:59:19 +12:00
WORKDIR /var/www/html
COPY --chown=nobody --from=build /app pathfinder
RUN chmod 0766 pathfinder/logs pathfinder/tmp/ && rm index.php && touch /etc/nginx/.setup_pass && chmod +x /entrypoint.sh
2020-08-30 19:59:19 +12:00
COPY static/pathfinder/routes.ini /var/www/html/pathfinder/app/
COPY static/pathfinder/environment.ini /var/www/html/pathfinder/app/templateEnvironment.ini
2021-09-05 13:27:54 +12:00
2020-08-30 19:59:19 +12:00
WORKDIR /var/www/html
EXPOSE 80
2021-09-05 13:27:54 +12:00
2020-08-30 19:59:19 +12:00
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]