Files
pfm/PostFundManagement.ShowcaseUI/Dockerfile
T
2026-10-29 17:40:48 +02:00

43 lines
1.0 KiB
Docker

# Stage 1: Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Enable corepack to use Yarn
RUN corepack enable
# Copy dependency definitions from the Showcase subdirectory
COPY PostFundManagement.ShowcaseUI/package*.json PostFundManagement.ShowcaseUI/yarn.lock* ./
# Install dependencies via Yarn
RUN yarn install --frozen-lockfile || yarn install
# Copy application source from the Showcase subdirectory
COPY PostFundManagement.ShowcaseUI/ ./
# Build Vite application for production
RUN yarn build
# Stage 2: Production Nginx Server
FROM nginx:alpine
WORKDIR /usr/share/nginx/html
# Copy nginx configuration
COPY --from=builder /app/nginx.conf /etc/nginx/conf.d/default.conf
# Copy compiled static assets from build stage
COPY --from=builder /app/dist ./
# Copy entrypoint script
COPY --from=builder /app/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Expose port 3000
EXPOSE 3000
# Set entrypoint and default command
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]