Add Dockerfile, docker-compose.yml and Gitea Actions workflow for CI/CD
This commit is contained in:
19
Dockerfile
Normal file
19
Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
# Build-Phase
|
||||
FROM node:20-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install --legacy-peer-deps
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Production-Phase
|
||||
FROM nginx:alpine
|
||||
|
||||
# Nginx konfigurieren für non-root Port 8080
|
||||
RUN sed -i 's/listen\( \)*80;/listen 8080;/g' /etc/nginx/conf.d/default.conf && \
|
||||
touch /var/run/nginx.pid && \
|
||||
chown -R nginx:nginx /var/run/nginx.pid /var/cache/nginx /var/log/nginx /etc/nginx/conf.d
|
||||
|
||||
USER nginx
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
EXPOSE 8080
|
||||
Reference in New Issue
Block a user