-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (32 loc) · 987 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (32 loc) · 987 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
30
31
32
33
34
35
# Spindle — single image: backend (Fastify) serves /api and the built Vue SPA.
# Build context is the repo root.
# 1. Build the frontend
FROM node:20-slim AS web
WORKDIR /web
COPY web/package*.json ./
RUN npm ci
COPY web/ ./
RUN npm run build
# 2. Build the backend
FROM node:20-slim AS api
WORKDIR /api
COPY backend/package*.json ./
RUN npm ci
COPY backend/tsconfig.json ./
COPY backend/src ./src
RUN npm run build
# 3. Runtime
FROM node:20-slim
WORKDIR /app
ENV NODE_ENV=production
# The backend serves the SPA from here (see WEB_DIR handling in config.ts/app.ts).
ENV WEB_DIR=/app/web
COPY backend/package*.json ./
RUN npm ci --omit=dev
COPY --from=api /api/dist ./dist
COPY --from=web /web/dist ./web
EXPOSE 3590
# Env (INGEST_SECRET, NAVIDROME_DB_PATH, SESSION_SECRET, SPINDLE_PASSWORD_HASH,
# NAVIDROME_URL/USER/PASSWORD, TRUST_PROXY, AUTH_COOKIE_SECURE, ...) is injected
# by the container runtime (compose env / -e), not baked into the image.
CMD ["node", "dist/server.js"]