forked from mbwatson/dug-search-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (31 loc) · 1021 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
# Build environment
###################
FROM node:13.12.0-alpine
RUN apk update && apk upgrade && apk add nginx
# Create and set working directory
RUN mkdir /src
WORKDIR /src
# Add `/usr/src/app/node_modules/.bin` to $PATH
ENV PATH /src/node_modules/.bin:$PATH
# Environment variable
ARG REACT_APP_API_ROOT=$REACT_APP_API_ROOT
ARG REACT_APP_DATA_API_ROOT=$REACT_APP_DATA_API_ROOT
# set path to run packages from node_modules
ENV NODE_PATH=/usr/src/app/node_modules/.bin
# Install and cache app dependencies
COPY package*.json /src/
RUN npm install
# Copy in source files
COPY . /src
RUN chown -R nginx:nginx /src && \
mkdir -p /usr/share/nginx/html && \
mkdir -p /run/nginx && \
touch /run/nginx/nginx.pid && \
chown -R nginx:nginx /etc/nginx && \
chown -R nginx:nginx /run/nginx/nginx.pid && \
chown -R nginx:nginx /usr/local/lib/node_modules && \
chown -R nginx:nginx /usr/share/nginx && \
chown -R nginx:nginx /var/log/nginx
USER nginx
EXPOSE 8080
CMD ["/src/entrypoint.sh"]