mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-09 21:27:47 +02:00
Add deployment and improve Dockerfiles and CICD
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user