diff --git a/Dockerfile b/Dockerfile index be12b9e..f3e5f9f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/startup.sh b/startup.sh new file mode 100644 index 0000000..c3f2366 --- /dev/null +++ b/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