Files
template_001/Dockerfile

27 lines
498 B
Docker

FROM node:20-alpine
ARG SOURCE_COMMIT=unknown
ARG APP_VERSION=1.0.0
WORKDIR /app
# 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
COPY . .
ENV GIT_COMMIT=${SOURCE_COMMIT} \
APP_VERSION=${APP_VERSION}
EXPOSE 3000
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=2 \
CMD curl -f http://localhost:3000/health || exit 1
CMD ["node", "server.js"]