Some checks are pending
Deploy to Production / deploy (push) Waiting to run
- Changed admin frontend port from 3000 to 3300 across all configuration files - Changed API backend port from 3001 to 3301 across all configuration files - Updated health check endpoints to use new ports in CI/CD workflow - Modified documentation and deployment guides to reflect new port numbers - Updated Caddy and Nginx reverse proxy configurations to use new ports
43 lines
915 B
Docker
43 lines
915 B
Docker
FROM node:18-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Build args
|
|
ARG VITE_API_URL=http://localhost:3301
|
|
ARG PNPM_FLAGS=--frozen-lockfile
|
|
|
|
# Copy workspace files
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
COPY apps/admin/package.json ./apps/admin/
|
|
|
|
# Install pnpm
|
|
RUN npm install -g pnpm
|
|
|
|
# Install dependencies
|
|
RUN pnpm install ${PNPM_FLAGS}
|
|
|
|
# Copy source
|
|
COPY apps/admin ./apps/admin
|
|
|
|
# Build with environment variable
|
|
WORKDIR /app/apps/admin
|
|
ENV VITE_API_URL=$VITE_API_URL
|
|
RUN pnpm run build
|
|
|
|
# Production image with nginx
|
|
FROM nginx:alpine
|
|
|
|
# Copy built files
|
|
COPY --from=builder /app/apps/admin/dist /usr/share/nginx/html
|
|
|
|
# Copy nginx config
|
|
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|