Skip to content

Commit 7a3ff2c

Browse files
committed
Add arg functionality
1 parent 7ca7b22 commit 7a3ff2c

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ services:
88
build:
99
context: .
1010
dockerfile: node.dockerfile
11+
args:
12+
buildversion: 1
1113
ports:
1214
- "3000:3000"
1315
networks:

node.dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ FROM node:alpine
2121

2222
LABEL author="Dan Wahlin"
2323

24+
ARG buildversion
25+
2426
ENV NODE_ENV=production
2527
ENV PORT=3000
28+
ENV build=$buildversion
2629

2730
WORKDIR /var/www
2831
COPY package.json package-lock.json ./
@@ -31,4 +34,6 @@ RUN npm install
3134
COPY . ./
3235
EXPOSE $PORT
3336

37+
RUN echo "Build version: $build"
38+
3439
ENTRYPOINT ["npm", "start"]

0 commit comments

Comments
 (0)