-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (30 loc) · 1.19 KB
/
Copy pathDockerfile
File metadata and controls
39 lines (30 loc) · 1.19 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
FROM node:20-slim
WORKDIR /app
# Install build tools for better-sqlite3
RUN apt-get update && apt-get install -y python3 make g++ && rm -rf /var/lib/apt/lists/*
# Install server dependencies. --legacy-peer-deps lets the OpenTelemetry
# auto-instrumentations package resolve its conflicting peer constraints
# (otel/core 1.x vs 2.x); without this `npm ci` fails on ERESOLVE.
COPY package*.json ./
RUN npm ci --only=production --legacy-peer-deps
# Install client dependencies and build
COPY client/package*.json client/
RUN cd client && npm ci --legacy-peer-deps
COPY client/ client/
RUN cd client && npx vite build
# Copy the credential-free capability layer BEFORE server code:
# server/publish/oauth.js requires ../../packages/social-ops, so an image
# without this directory fails the first X / IG / YouTube / TikTok / Reddit
# publish with MODULE_NOT_FOUND.
COPY packages/ packages/
# Copy server code
COPY server/ server/
# Copy docs/ — server/changelog.js reads docs/CHANGELOG.md at runtime to
# expose release notes via /api/changelog. Without this the parsed entries
# come back empty in prod.
COPY docs/ docs/
# Expose port
ENV PORT=8080
ENV BASE_PATH=""
EXPOSE 8080
CMD ["node", "server/index.js"]