issues/27: docker build webpack assets in image
This commit is contained in:
committed by
Valeriy Petrov
parent
162a49621b
commit
617945c730
+10
@@ -1,5 +1,14 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM node:24-alpine AS assets
|
||||
WORKDIR /app
|
||||
COPY package.json yarn.lock ./
|
||||
RUN corepack enable && yarn install --frozen-lockfile
|
||||
COPY webpack.config.js ./
|
||||
COPY assets ./assets
|
||||
COPY public ./public
|
||||
RUN yarn build
|
||||
|
||||
FROM composer:2 AS vendor
|
||||
WORKDIR /app
|
||||
COPY composer.json composer.lock* ./
|
||||
@@ -29,6 +38,7 @@ RUN cp /usr/share/zoneinfo/$TZ /etc/localtime && echo "$TZ" > /etc/timezone
|
||||
|
||||
COPY docker/fpm-pool.conf /usr/local/etc/php-fpm.d/zz-docker.conf
|
||||
COPY --from=vendor /app /app
|
||||
COPY --from=assets /app/public/build /app/public/build
|
||||
|
||||
RUN mkdir -p var/cache var/log public/uploads public/banners \
|
||||
&& chown -R www-data:www-data var public/uploads public/banners \
|
||||
|
||||
Reference in New Issue
Block a user