Update Dockerfile: node:20-alpine, remove bash syntax bug in ENV
This commit is contained in:
13
Dockerfile
13
Dockerfile
@@ -1,24 +1,21 @@
|
|||||||
FROM node:18-alpine
|
FROM node:20-alpine
|
||||||
|
|
||||||
# Build arguments - Coolify provides SOURCE_COMMIT automatically
|
|
||||||
ARG SOURCE_COMMIT=unknown
|
ARG SOURCE_COMMIT=unknown
|
||||||
ARG APP_VERSION=1.0.0
|
ARG APP_VERSION=1.0.0
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install curl for healthcheck and git for version control operations
|
# Install curl for healthcheck
|
||||||
RUN apk add --no-cache curl git
|
RUN apk add --no-cache curl
|
||||||
|
|
||||||
# Copy package files first for layer caching
|
# Copy package files first for layer caching
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install --production
|
RUN npm install --production
|
||||||
|
|
||||||
# Copy app code (changes more often — below the cached layer)
|
# Copy app code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Set environment variables for runtime
|
ENV GIT_COMMIT=${SOURCE_COMMIT} \
|
||||||
# Extract first 7 characters of SOURCE_COMMIT for short hash
|
|
||||||
ENV GIT_COMMIT=${SOURCE_COMMIT:0:7} \
|
|
||||||
APP_VERSION=${APP_VERSION}
|
APP_VERSION=${APP_VERSION}
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|||||||
Reference in New Issue
Block a user