forked from m0-foundation/ttg-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (34 loc) · 1.15 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
41
42
43
44
45
FROM node:20-alpine as build
#Setting environment variables
ARG VITE_APP_RPC_URL_MAIN
ARG VITE_APP_RPC_URL_FALLBACK
ARG VITE_APP_IS_AUCTION_ACTIVE
ARG VITE_APP_WALLET_CONNECT_PROJECT_ID
ARG BUILD_ENV
ENV VITE_APP_RPC_URL_MAIN ${VITE_APP_RPC_URL_MAIN}
ENV VITE_APP_RPC_URL_FALLBACK ${VITE_APP_RPC_URL_FALLBACK}
ENV VITE_APP_IS_AUCTION_ACTIVE ${VITE_APP_IS_AUCTION_ACTIVE}
ENV VITE_APP_WALLET_CONNECT_PROJECT_ID ${VITE_APP_WALLET_CONNECT_PROJECT_ID}
ENV BUILD_ENV ${BUILD_ENV}
# Create app directory
WORKDIR /usr/src/app
# Cache busting
ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache
# Install app dependencies
COPY package*.json yarn.lock ./
RUN apk add --update python3 make g++\
&& rm -rf /var/cache/apk/*
RUN yarn install
# Build app
COPY . .
RUN yarn build
EXPOSE 3000
EXPOSE 8545
CMD [ "yarn", "dev" ]
FROM nginx:stable-alpine
# "our" default.conf overwrites the nginx:stable's default.conf
COPY build/docker/nginx/conf.d/*.conf /etc/nginx/conf.d/
# Copy the built app from the build-stage
COPY --from=build /usr/src/app/.output/public /usr/share/nginx/html
# Add the maintance-page
COPY maintenance/ /usr/share/nginx/html/maintenance