Docker file fix and version in docker return proper envvar
This commit is contained in:
+3
-3
@@ -1,8 +1,8 @@
|
||||
FROM node:23-alpine3.21
|
||||
FROM node:24-alpine
|
||||
RUN apk upgrade --update-cache --available
|
||||
|
||||
ARG VERSION
|
||||
LABEL version=${VERSION}} description="BadgeDex"
|
||||
LABEL version=${VERSION} description="BadgeDex"
|
||||
ENV APP_VERSION=${VERSION}
|
||||
|
||||
# Create a group and user && Create directory for files
|
||||
@@ -18,7 +18,7 @@ USER badgedex
|
||||
COPY --chown=badgedex:badgedex . .
|
||||
|
||||
#Install dependencies
|
||||
RUN npm install
|
||||
RUN npm ci --only=production
|
||||
|
||||
# Expose API port
|
||||
EXPOSE 3000
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@ const fs = require('fs');
|
||||
|
||||
|
||||
const version = () => {
|
||||
if (process.env.VERSION) {
|
||||
return process.env.VERSION;
|
||||
if (process.env.APP_VERSION) {
|
||||
return process.env.APP_VERSION;
|
||||
}
|
||||
// Fallback to reading from a VERSION file
|
||||
const versionPath = require('path').resolve(__dirname, '../../VERSION');
|
||||
|
||||
Reference in New Issue
Block a user