-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
55 lines (43 loc) · 1.27 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
# build environment
FROM node:22-alpine AS build
WORKDIR /app
# Install deps
COPY package.json /app/package.json
COPY yarn.lock /app/yarn.lock
COPY .yarnrc.yml /app/.yarnrc.yml
RUN corepack enable
RUN yarn install --frozen-lockfile
# Copy source
COPY graphql /app/graphql
COPY prisma /app/prisma
COPY scrapers /app/scrapers
COPY scripts /app/scripts
COPY serializers /app/serializers
COPY services /app/services
COPY twilio /app/twilio
COPY types /app/types
COPY utils /app/utils
COPY infrastructure/prod /app
COPY babel.config.json /app
RUN yarn build
FROM node:22-alpine AS dist
WORKDIR /dist
RUN corepack enable
COPY --from=build /app/dist .
# TODO: This should be a `yarn workspaces focus --production` but
# the dev and non-dev deps are a tangled mess rn
RUN yarn workspaces focus
# Manually install openssl for Prisma. The Alpine image should already
# have it, but Prisma fails to detect it for some reason
RUN set -ex; \
apk update; \
apk add --no-cache \
openssl
# Get RDS Certificate
RUN apk update && apk add wget && rm -rf /var/cache/apk/* \
&& wget "https://s3.amazonaws.com/rds-downloads/rds-ca-2019-root.pem"
ENV dbCertPath=/app/rds-ca-2019-root.pem
ENV NODE_ENV=prod
ENTRYPOINT ["/dist/entrypoint.sh"]
EXPOSE 4000 8080
CMD ["node", "graphql/index.js"]