Update Dockerfile
This commit is contained in:
+12
-13
@@ -1,12 +1,16 @@
|
||||
### BUILDER IMAGE ###
|
||||
### Builder image ###
|
||||
FROM docker.io/superseriousbusiness/masto-fe-standalone-woodpecker-build:0.1.0 AS builder
|
||||
|
||||
# Prepare the build directory, copy
|
||||
# relevant source + config files over.
|
||||
WORKDIR /build
|
||||
|
||||
USER root
|
||||
RUN mkdir -p /build/.yarn && chown -R node:node /build
|
||||
USER node
|
||||
|
||||
COPY --chown=node:node app /build/app
|
||||
COPY --chown=node:node config /build/config
|
||||
COPY --chown=node:node public /build/public
|
||||
|
||||
COPY --chown=node:node \
|
||||
.browserslistrc \
|
||||
babel.config.js \
|
||||
@@ -16,19 +20,14 @@ COPY --chown=node:node \
|
||||
yarn.lock \
|
||||
/build/
|
||||
|
||||
# Create a production build of the frontend.
|
||||
RUN yarn && yarn build:production
|
||||
|
||||
### RUNTIME IMAGE ###
|
||||
FROM nginx:alpine AS runtime
|
||||
|
||||
# Copy bigger nested stuff.
|
||||
COPY --from=builder /build/public/packs/js/flavours/glitch /usr/share/nginx/html/packs/js/flavours/glitch
|
||||
COPY --from=builder /build/public/packs/js/flavours/vanilla /usr/share/nginx/html/packs/js/flavours/vanilla
|
||||
### Runtime image ###
|
||||
FROM docker.io/nginx:alpine
|
||||
|
||||
# Copy remaining files.
|
||||
COPY --from=builder /build/public /usr/share/nginx/html/
|
||||
COPY --from=builder /build/dist /usr/share/nginx/html
|
||||
|
||||
# Set up nginx.
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
Reference in New Issue
Block a user