forked from chrisleekr/binance-trading-bot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
72 lines (46 loc) · 1.51 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# development stage
FROM node:14-alpine AS dev-stage
RUN apk add --no-cache make gcc g++ py-pip
# Add configuration files
COPY image-files/ /
WORKDIR /srv
COPY package*.json ./
RUN npm install
COPY . .
ARG PACKAGE_VERSION=untagged
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
LABEL com.chrisleekr.binance-trading-bot.package-version=${PACKAGE_VERSION}
ARG GIT_HASH=unspecified
ENV GIT_HASH=${GIT_HASH}
LABEL com.chrisleekr.binance-trading-bot.git-hash=${GIT_HASH}
ARG NODE_ENV=development
ENV NODE_ENV=${NODE_ENV}
LABEL com.chrisleekr.binance-trading-bot.node-env=${NODE_ENV}
ENTRYPOINT [ "docker-entrypoint.sh" ]
CMD [ "npm", "run", "dev" ]
# build stage
FROM dev-stage AS build-stage
RUN npm run build:webpack
RUN npm run build:grunt
RUN rm -rf node_modules
RUN npm install --production
# production stage
FROM node:14-alpine AS production-stage
ARG PACKAGE_VERSION=untagged
ENV PACKAGE_VERSION=${PACKAGE_VERSION}
LABEL com.chrisleekr.binance-trading-bot.package-version=${PACKAGE_VERSION}
ARG GIT_HASH=unspecified
ENV GIT_HASH=${GIT_HASH}
LABEL com.chrisleekr.binance-trading-bot.git-hash=${GIT_HASH}
ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV}
LABEL com.chrisleekr.binance-trading-bot.node-env=${NODE_ENV}
# Add configuration files
COPY image-files/ /
WORKDIR /srv
COPY --from=build-stage /srv /srv
# Copy index production HTML to index.html
RUN cp /srv/public/index.html /srv/public/index.dev.html && \
cp /srv/public/index.prod.html /srv/public/index.html
ENTRYPOINT [ "docker-entrypoint.sh" ]
CMD [ "npm", "start"]