-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
51 lines (33 loc) · 1.03 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
#######################
# WARNING
# Do not ever publicly publish an image
# with a GOOGLE_CREDS build arg.
# Doing this is necessary for DO app platform,
# which has its own secret image registry and no
# other mechanism for supplying secrets as a file.
#######################
FROM node:16 as build
WORKDIR /build
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn/releases/ ./.yarn/releases/
COPY ./server/package.json ./server/
COPY ./shared/package.json ./shared/
RUN yarn
COPY . .
WORKDIR /build/server
# RUN yarn
RUN yarn build
FROM node:16-slim as app
WORKDIR /buzzwords
COPY package.json yarn.lock .yarnrc.yml ./
COPY .yarn/releases/ ./.yarn/releases/
WORKDIR /buzzwords/server
COPY ./server/package.json ./
ENV NODE_ENV=production
RUN yarn install
COPY ./server/words.json .
COPY --from=build /build/server/dist ./dist
ARG GOOGLE_CREDS
RUN echo $GOOGLE_CREDS | base64 --decode > ./google-credentials.json
ENV GOOGLE_APPLICATION_CREDENTIALS=/buzzwords/server/google-credentials.json
CMD ["node", "/buzzwords/server/dist/index.js"]