chg: pkg: make compatible the whole project with bare metal AND with docker #4
This commit is contained in:
52
Dockerfile
Normal file
52
Dockerfile
Normal file
@@ -0,0 +1,52 @@
|
||||
FROM node:22-alpine AS assets
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --ignore-scripts
|
||||
|
||||
COPY vite.config.js ./
|
||||
COPY assets/ assets/
|
||||
COPY public/ public/
|
||||
|
||||
RUN npm run build
|
||||
|
||||
FROM dunglas/frankenphp:latest
|
||||
|
||||
RUN install-php-extensions \
|
||||
pdo_pgsql \
|
||||
gd \
|
||||
intl \
|
||||
zip \
|
||||
opcache \
|
||||
apcu \
|
||||
sodium
|
||||
|
||||
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
|
||||
RUN printf '[opcache]\nopcache.enable=1\nopcache.memory_consumption=256\nopcache.max_accelerated_files=20000\nopcache.validate_timestamps=0\n' \
|
||||
> "$PHP_INI_DIR/conf.d/opcache.ini"
|
||||
|
||||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
||||
|
||||
ENV APP_ENV=prod
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN composer install \
|
||||
--no-dev \
|
||||
--no-interaction \
|
||||
--no-scripts \
|
||||
--optimize-autoloader
|
||||
|
||||
COPY --from=assets /app/public/build ./public/build
|
||||
|
||||
RUN mkdir -p var/cache var/log var/sessions && \
|
||||
chown -R www-data:www-data var/
|
||||
|
||||
COPY Caddyfile /etc/caddy/Caddyfile
|
||||
COPY docker/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
Reference in New Issue
Block a user