-
Notifications
You must be signed in to change notification settings - Fork 288
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 838 Bytes
/
Dockerfile
File metadata and controls
37 lines (28 loc) · 838 Bytes
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
# build environment
FROM node:12.16.2-alpine as builder
# Create working directory
RUN mkdir -p /usr/src/app/client
# Install required package dependencies
WORKDIR /usr/src/app/client
COPY client/package.json /usr/src/app/client/package.json
COPY client/yarn.lock /usr/src/app/client/yarn.lock
RUN yarn install
# Copy app source
WORKDIR /usr/src/app/client
COPY client /usr/src/app/client
ENV REACT_APP_OSS 1
ENV REACT_APP_PUBLIC_URL /
RUN yarn build
FROM node:12.16.2-alpine
RUN mkdir -p /usr/src/app/client
WORKDIR /usr/src/app
COPY package.json /usr/src/app/package.json
COPY yarn.lock /usr/src/app/yarn.lock
RUN yarn install
COPY server.js server.js
COPY .env.default .env
COPY --from=builder /usr/src/app/client/build /usr/src/app/client/build
ENV DEPLOYED "yes"
# production environment
EXPOSE 3000
CMD [ "yarn", "start" ]