-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (31 loc) · 1.08 KB
/
Dockerfile
File metadata and controls
38 lines (31 loc) · 1.08 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
# syntax=docker/dockerfile:1
# Stage 1: Base image.
## Start with a base image containing NodeJS so we can build Docusaurus.
FROM node:24-slim as base
## Enable corepack.
# RUN corepack enable
## Set the working directory to `/opt/docusaurus`.
WORKDIR /opt/docusaurus
# Stage: Production build mode.
FROM base as prod
## Set the working directory to `/opt/docusaurus`.
WORKDIR /opt/docusaurus
## Copy over the source code.
COPY . /opt/docusaurus/
## Install dependencies with `--immutable` to ensure reproducibility.
ARG STAKING_API_URL
ENV STAKING_API_URL=$STAKING_API_URL
ARG STAKING_API_DOC_JSON_URL
ENV STAKING_API_DOC_JSON_URL=$STAKING_API_DOC_JSON_URL
ARG APP_URL
ENV APP_URL=$APP_URL
RUN npm ci
## Build the static site.
RUN npm run build
# Serve with `docusaurus serve`.
FROM prod as serve
## Expose the port that Docusaurus will run on.
EXPOSE 3000
## Run the production server.
# CMD ["npm", "run", "serve", "--host 0.0.0.0", "--no-open"]
CMD ["sh", "-c", "STAKING_API_URL=$STAKING_API_URL STAKING_API_DOC_JSON_URL=$STAKING_API_DOC_JSON_URL npm run serve -- --host 0.0.0.0 --no-open"]