turash/bugulma/frontend/Dockerfile
Damir Mukimov e4b345fddc
Some checks failed
CI/CD Pipeline / frontend-lint (push) Successful in 1m38s
CI/CD Pipeline / frontend-build (push) Failing after 35s
CI/CD Pipeline / backend-lint (push) Failing after 7m3s
CI/CD Pipeline / backend-build (push) Has been skipped
CI/CD Pipeline / e2e-test (push) Has been skipped
Enable Corepack and set Yarn version in Dockerfile for frontend build
2025-12-26 15:52:19 +01:00

36 lines
652 B
Docker

# Frontend Production Dockerfile
FROM node:18-alpine AS builder
# Set working directory
WORKDIR /app
# Enable corepack and set yarn version
RUN corepack enable && corepack prepare yarn@4.12.0 --activate
# Copy package files
COPY package*.json yarn.lock ./
# Install dependencies
RUN yarn install --immutable
# Copy source code
COPY . .
# Build the application
RUN yarn build
# Production stage
FROM nginx:alpine
# Copy built assets from builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Expose port
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]