-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (21 loc) · 836 Bytes
/
Copy pathDockerfile
File metadata and controls
25 lines (21 loc) · 836 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
# Build the Honkit static site, then serve it with nginx.
# Dokploy: create an Application pointed at this repo, build type "Dockerfile". The container
# listens on port 80.
# ---- build stage ----
FROM node:20-alpine AS build
WORKDIR /app
# Install the book toolchain (honkit + plugins). The local "pagetoc" plugin is a file:
# dependency, so copy it in before installing.
COPY package.json package-lock.json ./
COPY tools ./tools
RUN npm install
# Build the site. Honkit reads SUMMARY.md / book.json and writes static HTML to _book.
COPY . .
RUN npx honkit build book ../_book
# ---- serve stage ----
FROM nginx:alpine
COPY --from=build /app/_book /usr/share/nginx/html
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
# Serve on 3000 to match Dokploy's default container port.
EXPOSE 3000
CMD ["nginx", "-g", "daemon off;"]