-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (22 loc) · 911 Bytes
/
Copy pathDockerfile
File metadata and controls
28 lines (22 loc) · 911 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
# ipfs-gate v0.1 — Dockerfile
FROM node:20-alpine
# better-sqlite3 needs build tools for native bindings
RUN apk add --no-cache python3 make g++ curl
WORKDIR /app
# Install deps first (cached layer when only source changes)
COPY package.json package-lock.json* ./
RUN npm ci --omit=dev
# App sources.
# Use a glob, NOT a hardcoded file list: an explicit list silently dropped
# pricing.js (Stage 1a) + release-policy.js (Stage 3) from the image, so the new
# server.js crash-looped on `Cannot find module './pricing'` → nginx 502. Globbing
# every top-level module means future stages (Stage 6+) ship automatically.
# (test/ is a subdir → not matched by *.js, so tests don't bloat the image.)
COPY *.js ./
COPY backends ./backends
COPY migrations ./migrations
# Data dir (mounted as volume in compose)
RUN mkdir -p /app/data && chown -R node:node /app
USER node
EXPOSE 3001
CMD ["node", "server.js"]