-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 770 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (24 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Build stage
FROM node:20 AS builder
WORKDIR /app
# Copy entire repo (including tsconfig.base.json)
COPY . .
# Install dependencies
RUN npm install -g pnpm && pnpm install --frozen-lockfile
# Build fazenda-brasil
WORKDIR /app/artifacts/fazenda-brasil
RUN PORT=3000 BASE_PATH=/ pnpm build
# Production stage
FROM node:20-slim
WORKDIR /app
# Install simple HTTP server
RUN npm install -g serve
# Copy built assets from builder
COPY --from=builder /app/artifacts/fazenda-brasil/dist/public ./dist
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --quiet --tries=1 --spider http://localhost:3000/ || exit 1
# Start server serving production build
CMD ["serve", "-s", "dist", "-l", "3000"]