Files
scoreodonto.com/frontend/Dockerfile
T

16 lines
564 B
Docker

# Stage 1: Build Vite React App
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Serve static files with high-performance Nginx on port 3013
FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
# Simple internal Nginx routing for single-page React router stability
RUN echo 'server { listen 3013; location / { root /usr/share/nginx/html; index index.html; try_files $uri $uri/ /index.html; } }' > /etc/nginx/conf.d/default.conf
EXPOSE 3013
CMD ["nginx", "-g", "daemon off;"]