feat: add Dockerfile for frontend deployment
Some checks are pending
K3s Auto-Deploy / build-and-deploy (push) Waiting to run

This commit is contained in:
Tiago Yamamoto 2026-03-07 12:02:03 -06:00
parent 7a06d4e691
commit c7ba7586b8

32
frontend/Dockerfile Normal file
View file

@ -0,0 +1,32 @@
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files and install dependencies
COPY package.json package-lock.json ./
RUN npm ci
# Copy source code and build
COPY . .
RUN npm run build
# Production stage (Nginx)
FROM nginx:alpine
# Copy built files to Nginx
COPY --from=builder /app/dist /usr/share/nginx/html
# Default Nginx config for Single Page Apps (Vite)
RUN echo 'server { \
listen 80; \
location / { \
root /usr/share/nginx/html; \
index index.html; \
try_files $uri $uri/ /index.html; \
} \
}' > /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]