forked from CashScript/cashscript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (24 loc) · 800 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
31
32
33
34
# BUILD IMAGE
FROM node:10 as build
WORKDIR /app
# Install and cache app dependencies
COPY website/package.json /app/package.json
COPY website/yarn.lock /app/yarn.lock
RUN yarn
# Invalidate cache from here on
ADD "http://worldtimeapi.org/api/timezone/Europe/Amsterdam.txt" skipcache
# Remove potentially cached Docusaurus files
RUN rm -rf /app/.docusaurus
RUN rm -rf /app/build
# Add app
COPY website /app
# Generate build
RUN yarn build
# ###############################################################################
# PROD IMAGE
FROM nginx:1.17.0-alpine
# Invalidate cache
ADD "http://worldtimeapi.org/api/timezone/Europe/Amsterdam.txt" skipcache
# Copy build artifacts from the 'build environment'
RUN rm -rf /usr/share/nginx/html/**
COPY --from=build /app/build /usr/share/nginx/html