-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (44 loc) · 1.26 KB
/
Dockerfile
File metadata and controls
56 lines (44 loc) · 1.26 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
# ── Stage 1: Install production dependencies ──────────────────────
FROM node:20-slim AS deps
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci --omit=dev
# ── Stage 2: Production image ─────────────────────────────────────
FROM node:20-slim
# Resvg needs fontconfig for system font fallback
RUN apt-get update && apt-get install -y --no-install-recommends \
libfontconfig1 \
&& rm -rf /var/lib/apt/lists/*
# Run as non-root
RUN groupadd -r app && useradd -r -g app app
WORKDIR /app
# Copy deps from build stage
COPY --from=deps /app/node_modules ./node_modules
# Copy application files
COPY package.json ./
COPY core.mjs ./
COPY tweet-fetch.mjs ./
COPY tweet-html.mjs ./
COPY tweet-render.mjs ./
COPY tweet-emoji.mjs ./
COPY tweet-fonts.mjs ./
COPY tweet-utils.mjs ./
COPY tweet-shots.mjs ./
COPY landing.html ./
COPY landing.js ./
COPY docs.html ./
COPY docs.js ./
COPY dashboard.js ./
COPY signup.js ./
COPY llm-docs.txt ./
COPY favicon.svg ./
COPY fonts/ ./fonts/
COPY src/ ./src/
# Set ownership
RUN chown -R app:app /app
USER app
ENV NODE_ENV=production
ENV PORT=8080
ENV TZ=UTC
EXPOSE 8080
CMD ["node", "src/server.mjs"]