feat: add debugging tools and startup delay for container

main
borja (aider) 3 months ago
parent 4df2fc776e
commit 084af2018e

@ -1,5 +1,8 @@
# Use official Bun image with Alpine for smaller size
FROM oven/bun as base
# 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)
@ -10,12 +13,16 @@ RUN bun install
COPY src/ ./src/
COPY index.ts ./
# Health check
# HEALTHCHECK --interval=30s --timeout=3s \
# CMD curl -f http://localhost:${PORT:-3007}/health || exit 1
# 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}
# Start the server
CMD ["bun", "run", "index.ts"]
# Make script executable
COPY startup.sh ./
RUN chmod +x startup.sh
# Start via wrapper script
CMD ["./startup.sh"]

@ -0,0 +1,7 @@
#!/bin/bash
# Wait for server to be ready
sleep 10
# Start the main process
exec bun run index.ts
Loading…
Cancel
Save