Files
t3mp3st/Dockerfile
T
Nicolas Pastorello 48b27bd6f5 fix: Docker healthcheck connection refused
- Bind to 0.0.0.0 inside containers (DOCKER=true env marker)
- Healthcheck was failing because localhost resolved to IPv6 ::1
  but server was bound to IPv4 127.0.0.1
- External exposure still protected via Coolify port mapping to 127.0.0.1
2026-07-06 19:35:02 -03:00

44 lines
822 B
Docker

# syntax=docker/dockerfile:1
FROM node:18-alpine
# Install dependencies
RUN apk add --no-cache \
bash \
curl \
git \
openssl \
ca-certificates
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY tsconfig.json ./
# Install dependencies
RUN npm ci && \
npm cache clean --force
# Copy source code
COPY . .
# Build TypeScript
RUN npm run build
# Ensure docs directory exists for /ui static files
RUN mkdir -p docs
# Docker environment marker (tells server.ts to bind to 0.0.0.0)
ENV DOCKER=true
# Expose port
EXPOSE 3333
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3333/api/health || exit 1
# Default command: run the server (not interactive CLI)
CMD ["npm", "run", "server"]