forked from Liquifact/Liquifact-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 706 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (21 loc) · 706 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
# Use Node.js 20 LTS as base image
FROM node:20-slim
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
# Using npm ci for reproducible builds
RUN npm ci --only=production
# Copy source code
COPY . .
# Set environment variables
ENV NODE_ENV=production
ENV PORT=3001
# Expose the API port
EXPOSE 3001
# Healthcheck — uses the readiness probe to verify the container can serve traffic
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD node -e "fetch('http://localhost:3001/readyz').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"
# Start the application
CMD ["node", "src/index.js"]