Files
lst_v3/Dockerfile

44 lines
824 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
###########
# Stage 1 #
###########
# Build stage with all dependencies
FROM node:24.12-alpine as build
WORKDIR /app
# Copy package files
COPY . .
# Install production dependencies only
RUN npm ci
RUN npm run build
###########
# Stage 2 #
###########
# Small final image with only whats needed to run
FROM node:24.12-alpine AS production
WORKDIR /app
# Copy package files first to install runtime deps
COPY package*.json ./
# curl install
RUN apk add --no-cache curl
# Only install production dependencies
RUN npm ci --omit=dev
COPY --from=build /app/dist ./dist
ENV RUNNING_IN_DOCKER=true
EXPOSE 3000
# start the app up
CMD ["npm", "run", "start:docker"]
# Add health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:3000/lst/api/stats || exit 1