James@SCF-GC
5ef0d12df4
Some checks failed
gitea_dndsources/schedulord-frontend/pipeline/head There was a failure building this commit
22 lines
641 B
Docker
22 lines
641 B
Docker
# STEP 1:
|
|
# Name the node stage "builder"
|
|
FROM node:16 AS builder
|
|
# 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
|
|
|
|
# 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
|
|
COPY --from=builder /app/dist/schedulord-frontend .
|
|
# Containers run nginx with global directives and daemon off
|
|
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
|
EXPOSE 80 |