-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
75 lines (50 loc) · 1.41 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
FROM node:16-slim as build
# See: https://github.com/prisma/prisma/issues/8478
RUN apt-get update
RUN apt-get install -y openssl
WORKDIR /app
COPY .yarn .yarn
COPY api api
COPY scripts scripts
COPY web web
COPY .nvmrc .
COPY .yarnrc.yml .
COPY graphql.config.js .
COPY package.json .
COPY redwood.toml .
COPY yarn.lock .
RUN \
yarn install --immutable && \
yarn cache clean
ARG WEB_ENV_VAR
RUN yarn rw build --verbose
# --
FROM node:16-slim as api
# See: https://github.com/prisma/prisma/issues/8478
RUN apt-get update
RUN apt-get install -y openssl wget
WORKDIR /app
COPY .yarn .yarn
COPY .yarnrc.yml .
COPY package.json .
COPY redwood.toml .
COPY yarn.lock .
COPY api/package.json .
COPY api/server.config.js .
COPY api/config/ecosystem.config.js .
RUN \
npm install -g pm2 && \
yarn workspaces focus --production api && \
yarn cache clean
COPY api/templates api/templates
COPY --from=build /app/api/dist api/dist
COPY --from=build /app/node_modules/.prisma node_modules/.prisma
EXPOSE 8911
ENTRYPOINT [ "pm2-runtime", "start", "api/config/ecosystem.config.js" ]
HEALTHCHECK --interval=5s CMD wget --no-verbose --tries=1 --spider http://localhost:8911/graphql/health || exit
# --
FROM caddy:2.6.2-alpine as web
COPY web/config/Caddyfile /etc/caddy/Caddyfile
COPY --from=build /app/web/dist /srv
EXPOSE 8080
HEALTHCHECK --interval=5s CMD wget --no-verbose --tries=1 --spider http://localhost:8080 || exit