-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (20 loc) · 922 Bytes
/
Dockerfile
File metadata and controls
28 lines (20 loc) · 922 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
ARG HUGO_VERSION=v0.159.1
FROM ghcr.io/gohugoio/hugo:${HUGO_VERSION}
ARG DOCSY_VERSION=v0.14.3
LABEL maintainer="CoMSES Net <support@comses.net>"
USER root
RUN git config --global --add safe.directory /src
# Install Node.js and npm for PostCSS (required by Docsy)
RUN apk add --no-cache nodejs npm go
# Install front-end tooling.
# Layer is invalidated only when package.json or package-lock.json changes.
# The BuildKit cache mount keeps the npm download cache across rebuilds so
# packages are never re-fetched from the network unnecessarily.
COPY package.json package-lock.json /tmp/
RUN --mount=type=cache,target=/root/.npm \
cd /tmp && npm ci && \
ln -sf /tmp/node_modules/.bin/postcss /usr/local/bin/postcss && \
ln -sf /tmp/node_modules/.bin/autoprefixer /usr/local/bin/autoprefixer
ENV NODE_PATH="/tmp/node_modules"
ENV PATH="/tmp/node_modules/.bin:${PATH}"
CMD ["server", "--bind", "0.0.0.0"]