-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathDockerfile
60 lines (45 loc) · 1.29 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM node:16-alpine AS builder
# Add a work directory
WORKDIR /app
ARG NODE_ENV
ENV NODE_ENV $NODE_ENV
ARG NX_PUBLIC_QOVERY_API
ENV NX_PUBLIC_QOVERY_API $NX_PUBLIC_QOVERY_API
ARG NX_PUBLIC_QOVERY_WS
ENV NX_PUBLIC_QOVERY_WS $NX_PUBLIC_QOVERY_WS
ARG NX_PUBLIC_OAUTH_DOMAIN
ENV NX_PUBLIC_OAUTH_DOMAIN $NX_PUBLIC_OAUTH_DOMAIN
ARG NX_PUBLIC_OAUTH_KEY
ENV NX_PUBLIC_OAUTH_KEY $NX_PUBLIC_OAUTH_KEY
ARG NX_PUBLIC_OAUTH_AUDIENCE
ENV NX_PUBLIC_OAUTH_AUDIENCE $NX_PUBLIC_OAUTH_AUDIENCE
ARG NX_PUBLIC_INTERCOM
ENV NX_PUBLIC_INTERCOM $NX_PUBLIC_INTERCOM
ARG NX_PUBLIC_POSTHOG
ENV NX_PUBLIC_POSTHOG $NX_PUBLIC_POSTHOG
ARG NX_PUBLIC_POSTHOG_APIHOST
ENV NX_PUBLIC_POSTHOG_APIHOST $NX_PUBLIC_POSTHOG_APIHOST
ARG NX_PUBLIC_GTM
ENV NX_PUBLIC_GTM $NX_PUBLIC_GTM
ARG NX_PUBLIC_ONBOARDING
ENV NX_PUBLIC_ONBOARDING $NX_PUBLIC_ONBOARDING
# Cache and Install dependencies
COPY package.json .
COPY yarn.lock .
COPY .yarn .yarn
COPY .yarnrc.yml .yarnrc.yml
RUN yarn install --immutable
# Copy app files
COPY . .
# Build the app
RUN yarn build
# Bundle static assets with nginx
FROM nginx:latest
# Copy built assets from builder
COPY --from=builder /app/dist/apps/* /usr/share/nginx/html
# Add your nginx.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]