-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-processor
More file actions
50 lines (38 loc) · 1.68 KB
/
Dockerfile-processor
File metadata and controls
50 lines (38 loc) · 1.68 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
FROM yeslogic/prince:16.2-debian-12-slim AS build
WORKDIR /usr/src/shapeshift
# Install Node and NPM
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends curl ca-certificates \
&& curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
# 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 yeslogic/prince:16.2-debian-12-slim
LABEL org.opencontainers.image.source="https://github.com/LibreTexts/shapeshift"
WORKDIR /usr/src/shapeshift
# Install Node only (no build tools needed at runtime)
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends curl ca-certificates \
&& curl -fsSL https://deb.nodesource.com/setup_24.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge -y curl \
&& apt-get autoremove -y
# 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 groupadd --system shapeshift && useradd --system --gid shapeshift shapeshift \
&& chown -R shapeshift:shapeshift /usr/src/shapeshift
USER shapeshift
ENTRYPOINT ["node", "build/workers/processor.mjs"]