Files
plex-playlist/Dockerfile.frontend
copilotcoder 836aaa632f
All checks were successful
CICD Start / Sanity and Base Decision (pull_request) Successful in 18s
fix(ci): use corepack for yarn berry in frontend build
Enable corepack and run yarn via corepack in Dockerfile.frontend install/build steps so packageManager=yarn@4.10.3 works in CI.
2026-06-21 07:47:31 -04:00

40 lines
1.0 KiB
Docker

# Frontend Dockerfile for Vue/Vite TypeScript project
FROM node:20-alpine AS base
# Set working directory
WORKDIR /app
# Copy package files first for better caching
COPY frontend/package*.json ./
COPY frontend/yarn.lock* frontend/pnpm-lock.yaml* ./
# Install dependencies
RUN if [ -f yarn.lock ]; then corepack enable && corepack yarn install; \
elif [ -f pnpm-lock.yaml ]; then npm install -g pnpm && pnpm install; \
else npm install; fi
# Copy application code
COPY frontend/ .
# Development stage
FROM base AS development
EXPOSE 5173
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
# Production build stage
FROM base AS build
RUN if [ -f yarn.lock ]; then corepack yarn build; \
elif [ -f pnpm-lock.yaml ]; then pnpm build; \
else npm run build; fi
# Production stage
FROM nginx:alpine AS production
# Copy built assets from build stage
COPY --from=build /app/dist /usr/share/nginx/html
# Copy nginx configuration
COPY frontend/nginx.conf /etc/nginx/nginx.conf
# Expose port
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]