You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
729 B
Docker

# Use standard Bun image for debugging (switch back to alpine later)
FROM oven/bun:1.1 as base
# Install basic debugging tools
RUN apt-get update && apt-get install -y curl netcat
WORKDIR /app
# Install dependencies first (better layer caching)
COPY package.json bun.lock ./
RUN bun install
# Copy only necessary files
COPY src/ ./src/
COPY index.ts ./
# More forgiving health check during debugging
HEALTHCHECK --start-period=30s --interval=30s --timeout=3s --retries=3 \
CMD curl -f http://localhost:${PORT:-3007}/health || exit 0
# Server runs on port from environment variable
EXPOSE ${PORT:-3007}
# Make script executable
COPY startup.sh ./
RUN chmod +x startup.sh
# Start via wrapper script
CMD ["./startup.sh"]