Skip to content

Commit 3ca3a3f

Browse files
authored
Engine Version as Env Var on Docker Image (#312)
* updated docker image to have a ENGINE_VERSION env var to know the current version of engine image being used * updated nightly image to have the ENGINE_VERSION env var value being set too * replace DOCKER_TAG with ENGINE_VERSION * added ARG to Dockerfile for engine vrsion env var
1 parent 46023d5 commit 3ca3a3f

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ jobs:
3333
platforms: linux/amd64,linux/arm64
3434
push: true
3535
tags: thirdweb/engine:nightly
36+
build-args: |
37+
ENGINE_VERSION=nightly

.github/workflows/tagBasedImageBuild.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@ jobs:
3131
tags: |
3232
thirdweb/engine:${{ github.ref_name }}
3333
thirdweb/engine:latest
34+
build-args: |
35+
ENGINE_VERSION=${{ github.ref_name }}

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ CMD [ "sh", "-c", "yarn prisma:setup:dev && yarn dev:worker" ]
6060
# Production Node Modules stage
6161
FROM node:18.15.0-alpine AS prod-dependencies
6262

63+
# Setting ENV variables for image information
64+
ARG ENGINE_VERSION
65+
ENV ENGINE_VERSION=${ENGINE_VERSION}
66+
6367
# Install build dependencies
6468
RUN apk add --no-cache g++ make py3-pip openssl
6569

src/server/routes/health.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { isDatabaseHealthy } from "../../db/client";
55

66
const ReplySchemaOk = Type.Object({
77
status: Type.String(),
8+
engineVersion: Type.Optional(Type.String()),
89
});
910

1011
const ReplySchemaError = Type.Object({
@@ -39,6 +40,7 @@ export async function healthCheck(fastify: FastifyInstance) {
3940

4041
res.status(StatusCodes.OK).send({
4142
status: "OK",
43+
engineVersion: process.env.ENGINE_VERSION || undefined,
4244
});
4345
},
4446
});

0 commit comments

Comments
 (0)