-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
78 lines (56 loc) · 1.79 KB
/
Dockerfile
File metadata and controls
78 lines (56 loc) · 1.79 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# ── Build stage ────────────────────────────
FROM node:20-alpine AS builder
WORKDIR /app
# Copy dependency manifests
COPY package*.json ./
# Install ALL dependencies (needed for build)
RUN npm ci
# Copy full source
COPY . .
# Build the API application
RUN npx nest build
# ── Runtime stage ──────────────────────────
FROM node:20-alpine AS runtime
WORKDIR /app
# Install curl for healthcheck
RUN apk add --no-cache curl
# Copy production deps from builder
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package*.json ./
# Copy built output
COPY --from=builder /app/dist ./dist
# Create logs directory
RUN mkdir -p /app/logs
# ── Environment defaults ──────────────────
# These can be overridden by docker-compose or runtime env
ENV NODE_ENV=production
ENV PORT=3001
# API Security
ENV ENABLE_API_KEY_AUTH=false
ENV API_KEYS=""
ENV API_KEY_HEADER_NAME=x-api-key
# Rate Limiting
ENV RATE_LIMIT_ENABLED=false
ENV RATE_LIMIT_REQUESTS=100
ENV RATE_LIMIT_TIMEFRAME=3600
# Caching
ENV ENABLE_CACHE=true
ENV CACHE_EXPIRY=3600
# Logging
ENV LOG_LEVEL=info
# CORS
ENV CORS_ORIGINS=*
# Search Defaults
ENV DEFAULT_SITE_NAMES=linkedin,indeed,zip_recruiter,glassdoor,google,bayt,naukri,bdjobs,internshala,exa,upwork
ENV DEFAULT_RESULTS_WANTED=20
ENV DEFAULT_DISTANCE=50
ENV DEFAULT_DESCRIPTION_FORMAT=markdown
ENV DEFAULT_COUNTRY=USA
# Swagger
ENV ENABLE_SWAGGER=true
ENV SWAGGER_PATH=api/docs
EXPOSE ${PORT}
# Health check (every 30s, 10s timeout, 5s start, 3 retries)
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:${PORT}/health || exit 1
CMD ["node", "dist/apps/api/main.js"]