Files
echoes-of-the-ash/Dockerfile.pwa
2025-11-07 15:27:13 +01:00

34 lines
546 B
Docker

# Build stage
FROM node:20-alpine AS build
WORKDIR /app
# Copy package files
COPY pwa/package*.json ./
# Install dependencies
RUN npm install
# Copy source code
COPY pwa/ ./
# Build the application
RUN npm run build
# Production stage
FROM nginx:alpine
# Copy built assets from build stage
COPY --from=build /app/dist /usr/share/nginx/html
# Copy game images
COPY images/ /usr/share/nginx/html/images/
# Copy nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]