-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (19 loc) · 838 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
FROM node:12-alpine
USER root
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"]