Some checks are pending
Deploy to Production / deploy (push) Waiting to run
- 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
50 lines
1.0 KiB
Docker
50 lines
1.0 KiB
Docker
FROM node:18-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
ARG PNPM_FLAGS=--frozen-lockfile
|
|
|
|
# Copy workspace files
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
COPY apps/api/package.json ./apps/api/
|
|
|
|
# Install pnpm
|
|
RUN npm install -g pnpm
|
|
|
|
# Install dependencies
|
|
RUN pnpm install ${PNPM_FLAGS}
|
|
|
|
# Copy source
|
|
COPY apps/api ./apps/api
|
|
|
|
# Production image
|
|
FROM node:18-alpine
|
|
|
|
WORKDIR /app
|
|
ARG PNPM_FLAGS=--frozen-lockfile
|
|
|
|
# Install pnpm and ts-node
|
|
RUN npm install -g pnpm ts-node typescript
|
|
|
|
# Copy package files
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
COPY apps/api/package.json ./apps/api/
|
|
|
|
# Install production dependencies
|
|
RUN pnpm install ${PNPM_FLAGS}
|
|
|
|
# Copy app from builder
|
|
COPY --from=builder /app/apps/api ./apps/api
|
|
|
|
WORKDIR /app/apps/api
|
|
|
|
# Create data directory
|
|
RUN mkdir -p /app/data
|
|
|
|
EXPOSE 3001
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
|
CMD node -e "require('http').get('http://localhost:3001/api/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
|
|
|
|
CMD ["pnpm", "run", "dev"]
|