Files
bolt-diy/Dockerfile
root f646ee43ce
Some checks failed
CI/CD / Test (push) Has been cancelled
CI/CD / Docker Build Validation (push) Has been cancelled
Docker Publish / docker-build-publish (push) Has been cancelled
Code Quality / Quality Analysis (push) Has been cancelled
Code Quality / Accessibility Tests (push) Has been cancelled
Code Quality / Performance Audit (push) Has been cancelled
Code Quality / PR Size Check (push) Has been cancelled
Security Analysis / CodeQL Analysis (javascript) (push) Has been cancelled
Security Analysis / CodeQL Analysis (typescript) (push) Has been cancelled
Security Analysis / Dependency Vulnerability Scan (push) Has been cancelled
Security Analysis / Secrets Detection (push) Has been cancelled
Update Stable Branch / prepare-release (push) Has been cancelled
Mark Stale Issues and Pull Requests / stale (push) Has been cancelled
Complete production setup with Express server
2025-12-11 17:50:51 +00:00

57 lines
1.2 KiB
Docker

# syntax=docker/dockerfile:1
FROM node:22-bookworm-slim AS base
# Install pnpm
RUN corepack enable && corepack prepare pnpm@9.15.9 --activate
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Dependencies stage
FROM base AS deps
COPY package.json pnpm-lock.yaml ./
# Install ALL dependencies (needed for build)
RUN pnpm install --frozen-lockfile
# Build stage
FROM base AS build
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Build the app
RUN pnpm run build
# Production stage
FROM base AS production
ENV NODE_ENV=production
ENV PORT=8788
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Install production dependencies
RUN pnpm install --prod --frozen-lockfile --ignore-scripts
# Copy built app
COPY --from=build /app/build ./build
COPY --from=build /app/server.mjs ./server.mjs
COPY --from=build /app/public ./public
EXPOSE 8788
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
CMD node -e "require('http').get('http://localhost:8788/api/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
CMD ["node", "server.mjs"]