-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (25 loc) · 727 Bytes
/
Dockerfile
File metadata and controls
32 lines (25 loc) · 727 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
# Node
FROM node:lts-alpine as build
# Initialize
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json /app/package.json
# Install requirements
RUN npm config set unsafe-perm true
RUN apk add --no-cache --virtual .gyp \
python \
make \
g++ \
&& npm install --production \
&& npm install react-scripts -g --production \
&& apk del .gyp
# Building app
COPY . /app
RUN npm run build
# Nginx
FROM nginx:stable-alpine
# Copying app build to nginx folder
COPY --from=build /app/build /usr/share/nginx/html
# Adding reserve proxy conf
COPY proxy.conf /etc/nginx/conf.d/default.conf
CMD sed -i -e 's/$PORT/'"$PORT"'/g' /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'