Refactor Dockerfile

This commit is contained in:
Oliver Davies 2021-07-24 20:38:35 +01:00
parent 09519cf89b
commit afbd1e302f
2 changed files with 11 additions and 9 deletions

View file

@ -1,21 +1,23 @@
FROM opdavies/sculpin-serve AS app
FROM app AS build
WORKDIR /app
COPY composer.* ./
RUN composer install
RUN composer install --no-dev
COPY app app
COPY source source
RUN sculpin generate -e prod
RUN sculpin generate --env prod
FROM node:14 AS assets
WORKDIR /node
WORKDIR /app
COPY package.json .
COPY package-lock.json .
RUN npm ci
COPY . .
RUN npm run production
FROM nginx AS production
COPY tools/docker/images/nginx/root /
WORKDIR /app
COPY --from=app /app/output_prod ./
COPY --from=assets /node/source/build build
FROM nginx:1 AS production
COPY tools/docker/images/nginx/root/ /
WORKDIR /usr/share/nginx/html
COPY --from=build /app/output_prod ./
COPY --from=assets /app/source/build build

View file

@ -391,7 +391,7 @@ server {
}
location / {
root /app;
root /usr/share/nginx/html;
index index.html index.htm;
error_page 404 /404.html;
}