This commit is contained in:
nisdas
2020-03-05 12:25:17 +08:00
parent 5463e29e84
commit e98ce5dead
2 changed files with 53 additions and 0 deletions

35
Dockerfile Executable file
View File

@@ -0,0 +1,35 @@
## docker build -t gcr.io/prysmaticlabs/documentation
FROM node:11-alpine as builder
RUN apk add --no-cache \
autoconf \
automake \
bash \
g++ \
libc6-compat \
libjpeg-turbo-dev \
libpng-dev \
make \
nasm
WORKDIR /app/website
COPY ./docs /app/docs
COPY ./website /app/website
COPY ./website/package.json ./website/package-lock.json ./
## Storing node modules on a separate layer will prevent unnecessary npm installs at each build
RUN npm i -g npm@6.4
RUN npm ci
RUN mv ./node_modules .
## Build the angular app in production mode and store the artifacts in dist folder
RUN npm run build
# Copy only the dist dir.
FROM nginx
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /app/website/build/prysm-docs /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]

18
docker-compose.yml Executable file
View File

@@ -0,0 +1,18 @@
version: "3"
services:
docusaurus:
build: .
ports:
- 3000:3000
- 35729:35729
volumes:
- ./docs:/app/docs
- ./website/blog:/app/website/blog
- ./website/core:/app/website/core
- ./website/i18n:/app/website/i18n
- ./website/pages:/app/website/pages
- ./website/static:/app/website/static
- ./website/sidebars.json:/app/website/sidebars.json
- ./website/siteConfig.js:/app/website/siteConfig.js
working_dir: /app/website