Files
sasa-membership/frontend/Dockerfile
James Pattinson d42b7cb307 Prod/Dev mode
2025-11-11 16:59:58 +00:00

36 lines
642 B
Docker

# Multi-stage Dockerfile for development and production
FROM node:18-alpine AS base
WORKDIR /app
# Copy package files
COPY package.json ./
# Install dependencies
RUN npm install
# Copy application files
COPY . .
# Development stage
FROM base AS development
EXPOSE 3000
CMD ["npm", "run", "dev"]
# Production build stage
FROM base AS build
RUN npm run build
# Production stage with Nginx
FROM nginx:alpine AS production
# Copy built files from build stage
COPY --from=build /app/dist /usr/share/nginx/html
# Copy custom nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]