Skip to content

Commit

Permalink
docker build arg env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
smoke-indica committed Jun 30, 2020
1 parent debd2da commit d6c3be2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
FROM node:7.5

ARG SOURCE_COMMIT
ENV SOURCE_COMMIT ${SOURCE_COMMIT}
ARG DOCKER_TAG
ENV DOCKER_TAG ${DOCKER_TAG}

# yarn > npm
#RUN npm install --global yarn

Expand Down
6 changes: 5 additions & 1 deletion src/server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ app.use(function* (next) {

if (this.method === 'GET' && this.url === '/.well-known/healthcheck.json') {
this.status = 200;
this.body = {status: 'ok'};
this.body = {
status: 'ok',
docker_tag: process.env.DOCKER_TAG ? process.env.DOCKER_TAG : false,
source_commit: process.env.SOURCE_COMMIT ? process.env.SOURCE_COMMIT : false,
};
return;
}

Expand Down

0 comments on commit d6c3be2

Please sign in to comment.