-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
executable file
·40 lines (36 loc) · 1.29 KB
/
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
FROM node:lts as build
ARG REACT_APP_BEE_URL
ENV REACT_APP_BEE_URL=$REACT_APP_BEE_URL
ARG REACT_APP_BEE_DEBUG_URL
ENV REACT_APP_BEE_DEBUG_URL=$REACT_APP_BEE_DEBUG_URL
ARG REACT_APP_FAIROS_URL
ENV REACT_APP_FAIROS_URL=$REACT_APP_FAIROS_URL
ARG REACT_APP_BLOCKCHAIN_INFO
ENV REACT_APP_BLOCKCHAIN_INFO=$REACT_APP_BLOCKCHAIN_INFO
ARG REACT_APP_ENVIRONMENT
ENV REACT_APP_ENVIRONMENT=$REACT_APP_ENVIRONMENT
ARG REACT_APP_WEB3_MODAL_PROJECT_ID
ENV REACT_APP_WEB3_MODAL_PROJECT_ID=$REACT_APP_WEB3_MODAL_PROJECT_ID
ARG REACT_APP_ALCHEMY_API_KEY
ENV REACT_APP_ALCHEMY_API_KEY=$REACT_APP_ALCHEMY_API_KEY
ARG REACT_APP_INVITE_URL
ENV REACT_APP_INVITE_URL=$REACT_APP_INVITE_URL
ARG REACT_APP_FAIRDRIVE_URL
ENV REACT_APP_FAIRDRIVE_URL=$REACT_APP_FAIRDRIVE_URL
WORKDIR /base
COPY *.json ./
RUN npm install
COPY . .
SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
RUN env |grep REACT > .default.env
RUN npm run build
#webserver
FROM nginx:stable-alpine
COPY --from=build /base/build /usr/share/nginx/html
RUN chown -R nginx /usr/share/nginx/html
RUN echo "real_ip_header X-Forwarded-For;" \
"real_ip_recursive on;" \
"set_real_ip_from 0.0.0.0/0;" > /etc/nginx/conf.d/ip.conf
RUN sed -i '/index index.html index.htm/c\ try_files $uri /index.html;' /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]