forked from cfpb/hmda-pub-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (24 loc) · 821 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
FROM node:8.16.0-alpine as build-stage
WORKDIR /usr/src/app
# install build dependencies
COPY package.json yarn.lock .yarnrc ./
# install packages offline
COPY npm-packages-offline-cache ./npm-packages-offline-cache
RUN yarn install
# create react app needs src and public directories
COPY src ./src
COPY public ./public
RUN yarn build
FROM nginx:1.16-alpine
RUN rm -rf /etc/nginx/conf.d
COPY nginx /etc/nginx
COPY --from=build-stage /usr/src/app/build /usr/share/nginx/html/data-publication
ENV NGINX_USER=svc_nginx_hmda
RUN adduser -S $NGINX_USER nginx && \
addgroup -S $NGINX_USER && \
addgroup $NGINX_USER $NGINX_USER && \
touch /run/nginx.pid && \
chown -R $NGINX_USER:$NGINX_USER /etc/nginx /run/nginx.pid /var/cache/nginx/
EXPOSE 8080
USER svc_nginx_hmda
CMD ["nginx", "-g", "daemon off;"]