-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (30 loc) · 1.54 KB
/
Copy pathDockerfile
File metadata and controls
35 lines (30 loc) · 1.54 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
# Build/preview container for the docs site.
#
# Hugo is deliberately NOT installed here. `npm ci` pulls the exact hugo-extended
# version pinned in package.json, so this container and a local checkout build with
# the same binary — one place to bump it, and no drift between "works in Docker"
# and "works on my machine". CI, once this repository has any, inherits that for
# free by running the same `npm ci`.
#
# Node 24 / npm 11.18 are Docsy v0.17's stated minimums.
FROM node:24-bookworm-slim
# git is not needed to build the site (enableGitInfo is off), but the entrypoint
# reports on submodule state and contributors expect it to exist in the shell.
RUN apt-get update \
&& apt-get install -y --no-install-recommends git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
# uid 1000, matching the typical host user, so everything written into the bind
# mount — node_modules, public/, resources/, and the fetched submodules — stays
# owned by the person running docker rather than by root.
USER node
EXPOSE 1313
# The entrypoint is read from the bind mount rather than copied into the image, so
# editing it takes effect on the next `docker compose up` with no image rebuild.
# The image is useless without the mount anyway — it carries no site content.
#
# Invoked through `sh` rather than executed directly, so it does not depend on the
# execute bit surviving however the tree reached the host (archive extraction, a
# copy across filesystems, a Windows checkout).
ENTRYPOINT ["/bin/sh", "/src/docker-entrypoint.sh"]
CMD ["npm", "run", "serve"]