forked from MiGoller/docker-http-mqtt-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (31 loc) · 751 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
#
# BUILD image
#
FROM node:8-alpine AS build
# Create the working dir
RUN mkdir -p /build
WORKDIR /build
# Install package dependencies
RUN apk add --update --no-cache python pkgconfig make g++ git
# Clone the source repo
RUN mkdir master_temp
RUN git clone https://github.com/fredguy/http_to_mqtt.git master_temp
RUN cp -R -f master_temp/* .
RUN rm -rf master_temp
# Install app
RUN npm install
#
# RUNTIME image
#
FROM node:8-alpine AS runtime
LABEL Author="MiGoller"
# Set environment variables to default values
ENV AUTH_KEY=SetToSomethingVerySpecial
COPY --from=build /build /app
WORKDIR /app
# Install NodeJS dependencies
RUN npm install pm2 -g
# Copy PM2 config
COPY pm2app.yml .
EXPOSE 1885
CMD ["pm2-docker", "pm2app.yml"]