Create a Docker image and deploy it

This commit is contained in:
2024-06-05 10:17:54 +02:00
parent 999dbee2c6
commit ab95e3d286
13 changed files with 269 additions and 2 deletions

32
Dockerfile Normal file
View File

@@ -0,0 +1,32 @@
FROM docker.io/dunglas/frankenphp:1-php8.3
RUN install-php-extensions \
@composer \
apcu \
intl \
opcache \
zip \
;
ENV APP_ENV=prod
ENV FRANKENPHP_CONFIG="import worker.Caddyfile"
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY frankenphp/conf.d/app.ini frankenphp/conf.d/app.prod.ini $PHP_INI_DIR/conf.d/
COPY frankenphp/Caddyfile /etc/caddy/Caddyfile
COPY frankenphp/worker.Caddyfile /etc/caddy/worker.Caddyfile
COPY frankenphp/start.sh .
COPY composer.json composer.lock symfony.lock ./
RUN composer install --no-cache --no-dev --no-autoloader --no-scripts --no-progress
COPY . .
RUN composer dump-autoload --classmap-authoritative --no-dev \
&& composer dump-env prod \
&& composer run-script --no-dev post-install-cmd \
;
RUN rm -Rf frankenphp/
ENTRYPOINT [ "/app/start.sh" ]