Refactor Dockerfile
This commit is contained in:
parent
09519cf89b
commit
afbd1e302f
|
@ -1,21 +1,23 @@
|
||||||
FROM opdavies/sculpin-serve AS app
|
FROM opdavies/sculpin-serve AS app
|
||||||
|
|
||||||
|
FROM app AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY composer.* ./
|
COPY composer.* ./
|
||||||
RUN composer install
|
RUN composer install --no-dev
|
||||||
COPY app app
|
COPY app app
|
||||||
COPY source source
|
COPY source source
|
||||||
RUN sculpin generate -e prod
|
RUN sculpin generate --env prod
|
||||||
|
|
||||||
FROM node:14 AS assets
|
FROM node:14 AS assets
|
||||||
WORKDIR /node
|
WORKDIR /app
|
||||||
COPY package.json .
|
COPY package.json .
|
||||||
COPY package-lock.json .
|
COPY package-lock.json .
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run production
|
RUN npm run production
|
||||||
|
|
||||||
FROM nginx AS production
|
FROM nginx:1 AS production
|
||||||
COPY tools/docker/images/nginx/root /
|
COPY tools/docker/images/nginx/root/ /
|
||||||
WORKDIR /app
|
WORKDIR /usr/share/nginx/html
|
||||||
COPY --from=app /app/output_prod ./
|
COPY --from=build /app/output_prod ./
|
||||||
COPY --from=assets /node/source/build build
|
COPY --from=assets /app/source/build build
|
||||||
|
|
|
@ -391,7 +391,7 @@ server {
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
root /app;
|
root /usr/share/nginx/html;
|
||||||
index index.html index.htm;
|
index index.html index.htm;
|
||||||
error_page 404 /404.html;
|
error_page 404 /404.html;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue