forked from openfga/openfga.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (32 loc) · 1.06 KB
/
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
35
36
37
38
39
40
41
42
43
FROM node:16-alpine as base
WORKDIR /home/node/app
RUN apk add curl bash nginx
ARG COOKIE_PRO_DATA_DOMAIN_ID
ARG HEAP_ID
ARG GOOGLE_TAG_MANAGER_ID
ARG API_DOCS_USE_ORIGIN=true
ARG SHOW_CUSTOMERS_PAGE
COPY package.json package-lock.json ./
RUN npm clean-install
COPY . .
## Development #################################################################
# Define a development target that installs devDeps and runs in dev mode
FROM base as development
WORKDIR /home/node/app
# Switch to the node user vs. root
USER node
# Expose port 3000
EXPOSE 3000
# Start the app in debug mode so we can attach the debugger
CMD ["npm", "start"]
## Production ##################################################################
# Also define a production target which doesn't use devDeps
FROM base as production
WORKDIR /home/node/app
# Build the Docusaurus app
RUN npm run build
COPY --chown=node:node . /home/node/app/
FROM nginx:stable-alpine as deploy
# Remove un-needed packages
RUN apk del freetype
COPY --chown=node:node --from=production /home/node/app/build /usr/share/nginx/html/