Add Dockerfile and CI

This commit is contained in:
Debian
2025-08-20 15:50:16 +00:00
parent c9c72e9488
commit 519fbe3dd0
2 changed files with 50 additions and 0 deletions

20
Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
# syntax=docker/dockerfile:1
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM nginx:1.27-alpine
COPY --from=build /app/dist /usr/share/nginx/html
# Serve SPA on port 3000 with history fallback
RUN printf 'server { \
listen 3000; \
server_name _; \
root /usr/share/nginx/html; \
index index.html; \
location / { try_files $uri /index.html; } \
}\n' > /etc/nginx/conf.d/default.conf
EXPOSE 3000
CMD ["nginx","-g","daemon off;"]