-
Notifications
You must be signed in to change notification settings - Fork 81
/
Dockerfile
30 lines (24 loc) · 963 Bytes
/
Dockerfile
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
## Base ########################################################################
# Use a larger node image to do the build for native deps (e.g., gcc, python)
FROM node:18-alpine as base
# Reduce npm log spam and colour during install within Docker
ENV NPM_CONFIG_LOGLEVEL=warn
ENV NPM_CONFIG_COLOR=false
# We'll run the app as the `node` user, so put it in their home directory
WORKDIR /home/node/app
# Copy the source code over
COPY . /home/node/app/
## Production ##################################################################
# Also define a production target which doesn't use devDeps
FROM base as build
WORKDIR /home/node/app
RUN npm ci
# Build the Docusaurus app
RUN npm run build
## Deploy ######################################################################
# Use a stable nginx image
FROM nginx
WORKDIR /home/node/app
# Copy what we've installed/built from production
COPY --from=build /home/node/app/build/ /usr/share/nginx/html/
EXPOSE 80