voxblog/docker/admin.Dockerfile
Ender d8c41cc206
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
docs: add comprehensive local Docker testing guide
- Created new LOCAL_TESTING.md with detailed instructions for setting up local development environment
- Added step-by-step setup guide covering Docker installation, environment configuration, and common commands
- Included troubleshooting section with solutions for common issues like port conflicts and build failures
- Added development workflow guidelines and testing checklist for quality assurance
- Documented performance tips and best practices for Docker
2025-10-25 23:42:24 +02:00

43 lines
915 B
Docker

FROM node:18-alpine AS builder
WORKDIR /app
# Build args
ARG VITE_API_URL=http://localhost:3001
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;"]