Files
htwkalender/frontend/Dockerfile
2024-02-06 20:16:27 +00:00

27 lines
520 B
Docker

# build stage
FROM node:lts-alpine AS build
WORKDIR /app
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ ./
RUN npm run build
# development stage
FROM node:lts-alpine AS dev
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . ./
# production stage
# https://hub.docker.com/r/bitnami/nginx -> always run as non-root user
FROM bitnami/nginx:1.25 AS prod
# copy build files from build container
COPY --from=build /app/dist /app
COPY ./frontend/nginx.conf /opt/bitnami/nginx/conf/nginx.conf
EXPOSE 8000