-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
46 lines (33 loc) · 1.1 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
# ----------------------------------------------------------- #
# Build the UI / Client app with React
# ----------------------------------------------------------- #
FROM node:16-alpine as builder
ARG SKIP_RECAPTCHA
ENV REACT_APP_SKIP_RECAPTCHA $SKIP_RECAPTCHA
ARG RECAPTCHA_SITE_KEY
ENV REACT_APP_RECAPTCHA_SITE_KEY $RECAPTCHA_SITE_KEY
ENV NODE_ENV=production
RUN apk update || : && apk add python3 git
COPY ./profile-server/client /client
WORKDIR /client
RUN yarn install
RUN yarn build
# ----------------------------------------------------------- #
# Build the Server component
#
# During this step, we will copy over the final React
# build output and handle those files as static from
# the root path of our server.
# ----------------------------------------------------------- #
FROM node:16-alpine
RUN apk update || : && apk add python3 git
RUN mkdir /app
WORKDIR /app
COPY profile-server/package.json ./package.json
# COPY profile-server/yarn.lock ./yarn.lock
RUN yarn
RUN yarn install
COPY ./profile-server/. ./
COPY .env ./.env
COPY --from=builder /client/build /app/client/build
CMD ["yarn", "start"]