2022-06-08 17:57:49 +00:00
|
|
|
# STEP 1:
|
|
|
|
# Name the node stage "builder"
|
2022-06-08 19:17:32 +00:00
|
|
|
FROM node:16 AS builder
|
2022-06-08 17:57:49 +00:00
|
|
|
# Set working directory
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy all files from current directory to working dir in image
|
|
|
|
COPY . .
|
|
|
|
# install node modules and build assets
|
|
|
|
RUN npm i && npm run build
|
2022-06-08 17:35:09 +00:00
|
|
|
|
2022-06-08 17:57:49 +00:00
|
|
|
# STEP 2:
|
|
|
|
# nginx state for serving content
|
|
|
|
FROM nginx:alpine
|
|
|
|
# Set working directory to nginx asset directory
|
|
|
|
WORKDIR /usr/share/nginx/html
|
|
|
|
# Remove default nginx static assets
|
|
|
|
RUN rm -rf ./*
|
|
|
|
# Copy static assets from builder stage
|
2022-06-08 18:08:21 +00:00
|
|
|
COPY --from=builder /app/dist/schedulord-frontend .
|
2022-06-08 17:57:49 +00:00
|
|
|
# Containers run nginx with global directives and daemon off
|
2022-06-08 18:29:51 +00:00
|
|
|
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
|
|
|
EXPOSE 80
|