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.
22 lines
491 B
Docker
22 lines
491 B
Docker
# Use official Bun image with Alpine for smaller size
|
|
FROM oven/bun as base
|
|
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 ./
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=3s \
|
|
CMD curl -f http://localhost:${PORT:-3007}/health || exit 1
|
|
|
|
# Server runs on port from environment variable
|
|
EXPOSE ${PORT:-3007}
|
|
|
|
# Start the server
|
|
CMD ["bun", "run", "index.ts"]
|