Files
homeassistant-mcp/Dockerfile
jango-blockchained f8bbe4af6f refactor(docker): optimize Dockerfiles for multi-stage builds and production deployment
- Implement multi-stage builds for main and speech Dockerfiles
- Reduce image size by using slim base images
- Improve dependency installation with frozen lockfile and production flags
- Add resource constraints and healthcheck to speech service Dockerfile
- Enhance build caching and separation of build/runtime dependencies
2025-02-04 19:41:23 +01:00

36 lines
704 B
Docker

# Use Bun as the base image
FROM oven/bun:1.0.25 as builder
# Set working directory
WORKDIR /app
# Copy only package files first for better layer caching
COPY package.json bun.lockb ./
# Install dependencies with production flag
RUN bun install --frozen-lockfile --production
# Copy source code
COPY . .
# Build TypeScript
RUN bun run build
# Create production image
FROM oven/bun:1.0.25-slim
WORKDIR /app
# Copy only the necessary files from builder
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
COPY package.json ./
# Set production environment
ENV NODE_ENV=production
# Expose port
EXPOSE 4000
# Start the application
CMD ["bun", "run", "start"]