Add deployment and improve Dockerfiles and CICD

This commit is contained in:
jkreller
2024-02-06 20:16:27 +00:00
committed by ekresse
parent b22c6c010b
commit 130dfb9698
12 changed files with 188 additions and 125 deletions

View File

@@ -1,7 +1,26 @@
FROM node:lts-alpine3.18
# 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 ./ ./
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