File tree Expand file tree Collapse file tree 2 files changed +22
-23
lines changed Expand file tree Collapse file tree 2 files changed +22
-23
lines changed Original file line number Diff line number Diff line change 1
- FROM node:8-alpine
2
-
3
- RUN apk add --no-cache git
1
+ FROM node:8-alpine AS builder
4
2
5
- # Set environment variables
6
- ENV USER_DIR=/usr/src/app
3
+ ENV STATUSFY_VERSION 0.3.1
7
4
ENV NODE_ENV production
8
- ENV STATUSFY_VERSION=0.3.1
5
+
6
+ WORKDIR /usr/src/app
7
+
8
+ RUN \
9
+ set -x \
10
+ && yarn install \
11
+ && yarn add "statusfy@$STATUSFY_VERSION" \
12
+ && npx statusfy build
13
+
14
+
15
+ FROM node:8-alpine
16
+
9
17
ENV NODE_ENV production
10
18
ENV HOST 0.0.0.0
11
19
ENV PORT 3000
20
+ ENV WORKDIR /usr/src/app
12
21
13
- RUN mkdir -p $USER_DIR
14
- RUN chown node:node "$USER_DIR"
15
- WORKDIR $USER_DIR
16
-
17
- # RUN yarn cache clean
18
- # RUN yarn global add "statusfy@$STATUSFY_VERSION"
22
+ COPY --from=builder --chown=node:node /usr/src/app/ $WORKDIR
19
23
20
24
COPY ./scripts/docker-start.sh /start.sh
21
- RUN chmod +x /start.sh
22
25
23
- VOLUME $USER_DIR
26
+ WORKDIR $WORKDIR
27
+ VOLUME $WORKDIR
24
28
EXPOSE $PORT
25
29
26
- CMD ["sh" , " /start.sh" ]
30
+ CMD ["/start.sh" ]
Original file line number Diff line number Diff line change 1
- #! /bin/bash
1
+ #! /bin/sh
2
+ set -e
2
3
3
- cd $USER_DIR
4
-
5
- yarn cache clean
6
- NODE_ENV=development yarn install
7
- yarn add " statusfy@$STATUSFY_VERSION "
8
-
9
- npx statusfy build
4
+ echo " Starting server..."
10
5
npx statusfy start
You can’t perform that action at this time.
0 commit comments