Refactor the production Docker image

This commit is contained in:
Oliver Davies 2021-07-03 23:00:45 +01:00
parent 54507c2d74
commit 1e66df30a1
6 changed files with 27 additions and 33 deletions

View file

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

View file

@ -1,2 +0,0 @@
FROM nginx:1 as base
COPY tools/docker/images/nginx/root /

View file

@ -603,4 +603,3 @@ server {
rewrite ^/wp-tailwind-static$ https://wp-tailwind.oliverdavies.uk;
rewrite ^/yXhoS$ /talks/things-you-should-know-about-php;
}

View file

@ -1,4 +0,0 @@
FROM node:14 AS base
WORKDIR /node
COPY package*.json ./
RUN npm install