-
Notifications
You must be signed in to change notification settings - Fork 100
/
Dockerfile
35 lines (28 loc) · 1.16 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
ARG NODE_VERSION=10.15.0
FROM node:${NODE_VERSION}-alpine as builder
ENV PATH /root/.yarn/bin:$PATH
ARG ethereum_network=rinkeby
ENV ETHEREUM_NETWORK=$ethereum_network
ARG build_environment=dev
ENV BUILD_ENVIRONMENT=$build_environment
RUN apk --no-cache add git
# begin create caching layer
COPY package.json yarn.lock /augur/
WORKDIR /augur
RUN yarn install --frozen-lockfile
# end create caching layer
COPY . /augur
RUN set -ex; \
if [ "$BUILD_ENVIRONMENT" = "dev" ]; then \
ETHEREUM_NETWORK=$ethereum_network yarn build --dev --augur-hosted --disableMainnet; \
elif [ "$BUILD_ENVIRONMENT" = "dev-optimized" ]; then \
ETHEREUM_NETWORK=$ethereum_network yarn build --production --augur-hosted --disableMainnet; \
elif [ "$BUILD_ENVIRONMENT" = "latest" ]; then \
ETHEREUM_NETWORK=$ethereum_network yarn build --production --augur-hosted; \
fi;
# need arg to pass in for augur-ui (production) and augur-dev (dev)
RUN git rev-parse HEAD > /augur/build/git-hash.txt \
&& git log -1 > /augur/build/git-commit.txt
FROM nginx:alpine
COPY --from=builder /augur/build/ /augur/build
COPY support/nginx-default.conf /etc/nginx/conf.d/default.conf