Files
lst_v3/Dockerfile
Blake Matthes beae6eb648
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m57s
lots of changes with docker
2026-04-03 09:51:52 -05:00

50 lines
975 B
Docker
Raw Permalink 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 . .
# build backend
RUN npm ci
RUN npm run build:docker
# build frontend
RUN npm --prefix frontend ci
RUN npm --prefix frontend 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
COPY --from=build /app/frontend/dist ./frontend/dist
# TODO add in drizzle migrates
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