fix: deployment issues and add health check
parent
2e40bd8522
commit
027e11523e
@ -1,16 +1,21 @@
|
||||
# Use official Bun image for optimal performance
|
||||
FROM oven/bun:1.1 as base
|
||||
# Use official Bun image with Alpine for smaller size
|
||||
FROM oven/bun:1.1-alpine as base
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies first (better layer caching)
|
||||
COPY package.json ./
|
||||
RUN bun install
|
||||
COPY package.json bun.lock ./
|
||||
RUN bun install --production
|
||||
|
||||
# Copy all source files
|
||||
COPY . .
|
||||
# Copy only necessary files
|
||||
COPY src/ ./src/
|
||||
COPY index.ts ./
|
||||
|
||||
# Server runs on port 3007 by default (override with PORT env var)
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=3s \
|
||||
CMD curl -f http://localhost:3007/health || exit 1
|
||||
|
||||
# Server runs on port 3007 by default
|
||||
EXPOSE 3007
|
||||
|
||||
# Start the server (env vars will be injected by CapRover)
|
||||
# Start the server
|
||||
CMD ["bun", "run", "index.ts"]
|
||||
|
Loading…
Reference in New Issue