feat: déploiement initial recette Santinova
This commit is contained in:
68
Dockerfile
Normal file
68
Dockerfile
Normal file
@@ -0,0 +1,68 @@
|
||||
# ============================================================
|
||||
# STAGE 1: Build Frontend + Backend
|
||||
# ============================================================
|
||||
FROM node:22-alpine AS builder
|
||||
|
||||
# Install system dependencies for sharp and pdf processing
|
||||
RUN apk add --no-cache \
|
||||
python3 \
|
||||
make \
|
||||
g++ \
|
||||
poppler-utils \
|
||||
vips-dev
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install pnpm
|
||||
RUN npm install -g pnpm@10.4.1
|
||||
|
||||
# Copy package files
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
COPY patches/ ./patches/
|
||||
|
||||
# Install dependencies
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build frontend + backend
|
||||
RUN pnpm build
|
||||
|
||||
# ============================================================
|
||||
# STAGE 2: Production image
|
||||
# ============================================================
|
||||
FROM node:22-alpine AS production
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apk add --no-cache \
|
||||
poppler-utils \
|
||||
vips \
|
||||
curl
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install pnpm for production deps
|
||||
RUN npm install -g pnpm@10.4.1
|
||||
|
||||
# Copy package files
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
COPY patches/ ./patches/
|
||||
|
||||
# Install production dependencies only
|
||||
RUN pnpm install --frozen-lockfile --prod
|
||||
|
||||
# Copy built assets from builder
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/client/dist ./client/dist
|
||||
|
||||
# Copy drizzle migrations
|
||||
COPY drizzle/ ./drizzle/
|
||||
COPY drizzle.config.ts ./
|
||||
|
||||
# Create uploads directory
|
||||
RUN mkdir -p /app/uploads
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", "dist/index.js"]
|
||||
Reference in New Issue
Block a user