Files
ai-stack-deployer/Dockerfile
Oussama Douhou eb6d5142ca feat: add CI/CD workflow and update documentation
- Add .gitea/workflows/docker-publish.yaml for automated builds
- Configure workflow to trigger on main branch
- Update README.md with deployment instructions
- Update START-HERE.md with session context

This enables automatic Docker image builds tagged as :latest and :<sha>
when pushing to main branch.
2026-01-09 23:44:02 +01:00

49 lines
1.0 KiB
Docker

# Use official Bun image
# ***NEVER FORGET THE PRINCIPLES RULES***
FROM oven/bun:1.3-alpine AS base
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json bun.lock* ./
# Install dependencies
FROM base AS deps
RUN bun install --frozen-lockfile --production
# Build stage
FROM base AS builder
RUN bun install --frozen-lockfile
COPY . .
RUN bun run build
# Production stage
FROM oven/bun:1.3-alpine AS runner
WORKDIR /app
# Create non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S nodejs -u 1001
# Copy necessary files
COPY --from=deps /app/node_modules ./node_modules
COPY --from=builder /app/src ./src
COPY --from=builder /app/package.json ./
# Set permissions
RUN chown -R nodejs:nodejs /app
# Switch to non-root user
USER nodejs
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD bun --eval 'fetch("http://localhost:3000/health").then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))'
# Start the application
CMD ["bun", "run", "start"]