Skip to content
This repository was archived by the owner on Nov 22, 2021. It is now read-only.

Commit 00fa178

Browse files
author
Ke, Mingze
committed
Update Dockerfile
1 parent 71a2e1d commit 00fa178

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

Dockerfile

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,30 @@
1-
FROM mhart/alpine-node:4
1+
FROM mhart/alpine-node:6
22

33
WORKDIR /src
44
ADD . /src
55

6+
ARG env=production
7+
8+
RUN apk update
9+
10+
ENV PATH /root/.yarn/bin:$PATH
11+
12+
RUN apk update \
13+
&& apk add curl bash binutils tar \
14+
&& rm -rf /var/cache/apk/* \
15+
&& curl -o- -L https://yarnpkg.com/install.sh | sh \
16+
&& apk del curl tar binutils
17+
618
# If you have native dependencies, you'll need extra tools
7-
RUN apk add --no-cache make gcc g++ python
19+
RUN apk add --no-cache make gcc g++ git python
820

921
# If you need npm, don't use a base tag
10-
RUN npm install
22+
RUN NODE_ENV=production yarn install
23+
24+
WORKDIR /src
25+
RUN rm -rf .git .gitmodules
1126

1227
EXPOSE 8080
1328

14-
ENV NODE_ENV production
29+
ENV NODE_ENV $env
1530
CMD ["npm", "start"]

0 commit comments

Comments
 (0)