-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (24 loc) · 1.05 KB
/
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
FROM node:12
USER root
RUN apt-get update \
&& apt-get install -y build-essential python git-core \
&& git clone https://github.com/joan2937/pigpio \
&& (cd pigpio ; make install) \
&& rm -rf pigpio /var/cache/apt/archives/* /var/lib/apt/lists/*
RUN npm i [email protected] -g
# install dependencies first, in a different location for easier app bind mounting for local development
# due to default /opt permissions we have to create the dir with root and change perms
RUN mkdir /opt/node_app && chown node:node /opt/node_app
WORKDIR /opt/node_app
COPY package.json package-lock.json* ./
RUN npm install && npm cache clean --force
ENV PATH /opt/node_app/node_modules/.bin:$PATH
# check every 30s to ensure this service returns HTTP 200
# HEALTHCHECK --interval=30s CMD node healthcheck.js
# copy in our source code last, as it changes the most
WORKDIR /opt/node_app/app
COPY . .
# COPY docker-entrypoint.sh /usr/local/bin/
# https://github.com/BretFisher/node-docker-good-defaults
# ENTRYPOINT ["docker-entrypoint.sh"]
ENTRYPOINT ["node", "exporter.js"]