-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (27 loc) · 897 Bytes
/
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
FROM node:8.10.0 as builder
# create app directory in container
RUN mkdir -p /app
# set /app directory as default working directory
WORKDIR /app
# only copy package.json initially so that `RUN yarn` layer is recreated only
# if there are changes in package.json
ADD package.json yarn.lock /app/
# --pure-lockfile: Don’t generate a yarn.lock lockfile
RUN yarn --pure-lockfile
# copy all file from current dir to /app in container
COPY . /app/
RUN yarn copy
RUN yarn babel
FROM node:8.10.0
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
# expose port 4000
EXPOSE 4000
## THE LIFE SAVER
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait /wait
RUN chmod +x /wait
## Launch the wait tool and then your application
CMD /wait && node dist/index.js
# cmd to start service
#CMD [ "node", "dist/index.js"]