--wip-- [skip ci]
Some checks failed
Cadoles/hydra-sql/pipeline/head There was a failure building this commit
Some checks failed
Cadoles/hydra-sql/pipeline/head There was a failure building this commit
This commit is contained in:
62
misc/images/hydra-sql-prod/Dockerfile
Normal file
62
misc/images/hydra-sql-prod/Dockerfile
Normal file
@@ -0,0 +1,62 @@
|
||||
|
||||
## NPM INSTALL ##
|
||||
FROM node:24.7.0 AS npm-install
|
||||
|
||||
ARG ENCORE_MODE=production
|
||||
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
|
||||
RUN npm install \
|
||||
&& npm run build
|
||||
|
||||
|
||||
## COMPOSER INSTALL ##
|
||||
FROM dunglas/frankenphp:1.9.1-php8.4-bookworm AS composer-install
|
||||
|
||||
ARG APP_ENV=prod \
|
||||
APP_DEBUG=0 \
|
||||
APP_LOCALES="fr,en" \
|
||||
BASE_PATH=""
|
||||
|
||||
COPY ./misc/files/Caddyfile /etc/frankenphp/Caddyfile
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=npm-install /app .
|
||||
COPY --from=composer /usr/bin/composer /usr/bin/composer
|
||||
|
||||
RUN apt-get -y update \
|
||||
&& apt-get -y install git \
|
||||
&& install-php-extensions \
|
||||
opcache \
|
||||
apcu \
|
||||
&& composer install --ignore-platform-reqs --no-cache -a --no-dev \
|
||||
&& composer dump-autoload --no-dev --classmap-authoritative \
|
||||
&& bin/console assets:install --symlink --relative
|
||||
|
||||
|
||||
## FINAL IMAGE ##
|
||||
FROM dunglas/frankenphp:1.9.1-php8.4-bookworm
|
||||
|
||||
ARG VERSION
|
||||
|
||||
ENV APP_ENV=prod \
|
||||
APP_DEBUG=0 \
|
||||
APP_LOCALES="fr,en" \
|
||||
BASE_PATH="" \
|
||||
VERSION=${VERSION}
|
||||
|
||||
COPY ./misc/files/Caddyfile /etc/frankenphp/Caddyfile
|
||||
COPY ./misc/files/frankenphp.caddyfile-prod /etc/frankenphp/Caddyfile.d/frankenphp.caddyfile
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=composer-install /app .
|
||||
|
||||
RUN cp $PHP_INI_DIR/php.ini-development $PHP_INI_DIR/php.ini \
|
||||
&& install-php-extensions \
|
||||
pdo_pgsql \
|
||||
pdo_mysql \
|
||||
opcache \
|
||||
apcu
|
Reference in New Issue
Block a user