-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
48 lines (39 loc) · 1017 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
40
41
42
43
44
45
46
47
48
#TODO: use rpio which is faster and can build on node 10+
FROM node:alpine AS base
EXPOSE 3000
ENTRYPOINT ["node"]
CMD ["server"]
HEALTHCHECK --start-period=5s \
CMD curl --fail localhost:3000/api/v1/health || exit 1
# Create app directory
RUN mkdir -p /usr/src/app/dist
WORKDIR /usr/src/app
# Install updates
RUN apk update && \
apk upgrade && \
apk add curl
COPY package.json \
package-lock.json \
/usr/src/app/
# Install build dependencies
FROM base AS build
RUN apk add git python make g++
# Install app dependencies
RUN npm install
# Make app
FROM base
COPY --from=build /usr/src/app/node_modules /usr/src/app/node_modules
# Bundle app source
COPY dist/favicon* /usr/src/app/dist/
COPY migrations /usr/src/app/migrations
COPY lib /usr/src/app/lib
COPY api /usr/src/app/api
COPY webapp /usr/src/app/webapp
COPY test /usr/src/app/test
COPY server.js \
door.js \
webpack.config.js \
.eslintrc.json \
/usr/src/app/
# Build webapp
RUN node_modules/.bin/webpack