shinkan-jinkendo/frontend/Dockerfile
Lars e4d052f182
All checks were successful
Deploy Development / deploy (push) Successful in 33s
fix: Add nginx SPA routing config
2026-04-21 16:30:11 +02:00

35 lines
530 B
Docker

# Build stage
FROM node:20-alpine AS build
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy source code
COPY . .
# Build argument for API URL
ARG VITE_API_URL
ENV VITE_API_URL=$VITE_API_URL
# Build app
RUN npm run build
# Production stage
FROM nginx:alpine
# Copy built app
COPY --from=build /app/dist /usr/share/nginx/html
# Copy nginx config for SPA routing
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]