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 APP_VERSION=1.0.0
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install curl for healthcheck and git for version control operations
|
||||
RUN apk add --no-cache curl git
|
||||
# Install curl for healthcheck
|
||||
RUN apk add --no-cache curl
|
||||
|
||||
# Copy package files first for layer caching
|
||||
COPY package*.json ./
|
||||
RUN npm install --production
|
||||
|
||||
# Copy app code (changes more often — below the cached layer)
|
||||
# Copy app code
|
||||
COPY . .
|
||||
|
||||
# Set environment variables for runtime
|
||||
# Extract first 7 characters of SOURCE_COMMIT for short hash
|
||||
ENV GIT_COMMIT=${SOURCE_COMMIT:0:7} \
|
||||
ENV GIT_COMMIT=${SOURCE_COMMIT} \
|
||||
APP_VERSION=${APP_VERSION}
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
Reference in New Issue
Block a user