Skip to content

Commit 3330354

Browse files
fedde-sRobinM-code
authored andcommitted
Add the gitRevision setting as a Docker build arg
1 parent 03207ad commit 3330354

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FROM node:18 AS build
22
# make sure app variable is set and valid
33
ARG app=""
44
RUN : "${app:?Missing --build-arg app}"
5+
56
RUN case "$app" in platform) true;; genetics) true;; *) echo "variable 'app' must be set to either 'platform' or 'genetics'"; false;; esac
67
# assert that a compatible yarn version is installed or fail
78
RUN case `yarn --version` in 1.22*) true;; *) false;; esac
@@ -13,8 +14,13 @@ RUN yarn build:$app
1314
RUN mv ./apps/$app/bundle-$app/ ./bundle/
1415

1516
FROM node:18
17+
18+
ARG git_version=""
19+
RUN : "${git_version:?Missing --build-arg git_version=\$(git rev-parse --short HEAD)}"
20+
1621
RUN npm install --location=global serve
1722
COPY --from=build /tmp/app/bundle/ /var/www/app/
1823
WORKDIR /var/www/app/
24+
RUN echo "var gitVersion = '$git_version'" >config.js
1925
EXPOSE 80
2026
CMD ["serve", "--no-clipboard", "--single", "-l", "tcp://0.0.0.0:80"]

0 commit comments

Comments
 (0)