Skip to content

Commit dab615d

Browse files
committed
Add Dockerfile & Makefile
1 parent aec1b3f commit dab615d

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
.git
3+
.gitignore
4+
5+
node_modules
6+
npm-debug.log
7+
8+
dist

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM node:lts-alpine
2+
3+
ENV NODE_ENV production
4+
5+
COPY package*.json /app/mongodb-grafana/
6+
7+
WORKDIR /app/mongodb-grafana/
8+
9+
RUN npm install --production
10+
11+
# Bundle app source
12+
COPY . .
13+
14+
WORKDIR /app/mongodb-grafana/server/
15+
16+
EXPOSE 3333
17+
USER nobody
18+
19+
CMD ["node", "/app/mongodb-grafana/server/mongodb-proxy.js"]

Makefile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
NAME=mongodb-grafana-proxy
2+
VERSION=$(shell cat package.json | grep version | head -1 | sed 's/.*: "\([^"]*\)".*/\1/')
3+
PORT=3333
4+
REGISTRY_PREFIX=$(if $(REGISTRY),$(addsuffix /, $(REGISTRY)))
5+
6+
.PHONY: build publish
7+
8+
build:
9+
docker build -t ${NAME}:${VERSION} .
10+
11+
publish:
12+
docker tag ${NAME}:${VERSION} ${REGISTRY_PREFIX}${NAME}:${VERSION}
13+
docker push ${REGISTRY_PREFIX}${NAME}:${VERSION}

0 commit comments

Comments
 (0)