-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-api
More file actions
34 lines (24 loc) · 1 KB
/
Dockerfile-api
File metadata and controls
34 lines (24 loc) · 1 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
FROM node:lts-alpine3.23 AS build
WORKDIR /usr/src/shapeshift
# Install all deps (dev included for build)
COPY package*.json ./
RUN npm ci && npm cache clean --force
# Build
COPY . .
RUN npm run build
# ── Runtime stage ─────────────────────────────────────────────
FROM node:lts-alpine3.23
LABEL org.opencontainers.image.source="https://github.com/LibreTexts/shapeshift"
WORKDIR /usr/src/shapeshift
# Prod-only deps
COPY package*.json ./
RUN npm ci --omit=dev --ignore-scripts && npm cache clean --force
# Copy build output from build stage
COPY --from=build /usr/src/shapeshift/build ./build
# Bundled code resolves styles via __dirname/../styles (relative to build/)
RUN ln -s build/styles styles
# Run as non-root
RUN addgroup --system shapeshift && adduser --system --ingroup shapeshift shapeshift \
&& chown -R shapeshift:shapeshift /usr/src/shapeshift
USER shapeshift
ENTRYPOINT ["node", "build/workers/api.mjs"]