-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
50 lines (35 loc) · 1009 Bytes
/
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
# https://github.com/nodejs/docker-node/blob/170ed2092d4925971f9cd3ad5dfc416e820f90fd/10/alpine/Dockerfile
FROM node:10.15.3-alpine
# Create app directory
RUN mkdir /opt/app && chown node:node /opt/app
RUN apk add --update git && \
rm -rf /tmp/* /var/cache/apk/*
WORKDIR /opt/app
# Public files
COPY public ./public
RUN chown -R node:node ./public
USER node
# Yarn and webpack configs
COPY package.json ./
COPY yarn.lock ./
COPY webpack.config.js ./
# Babel 7 presets and plugins
COPY .babelrc ./
# ESLint configuration
COPY .eslintrc.js ./
COPY .eslintignore ./
# Env variables
COPY .env.development ./
# Client and server files
COPY client ./client
COPY server ./server
# Environment variables
ARG NLSOF_AUTH
ARG FHA_FINDS_AUTH
ENV NLSOF_AUTH=${NLSOF_AUTH}
ENV FHA_FINDS_AUTH=${FHA_FINDS_AUTH}
# Run the scripts defined in package.json
RUN yarn && yarn build:prod
EXPOSE 3001
# Express server handles the backend functionality and also serves the React app
CMD ["node", "./server/server.js"]