Files
Hira 4cb903f2f7
CI / CD / Lint & Build (CI) (push) Successful in 11m42s
CI / CD / Build & Push Docker Image (CD) (push) Failing after 3m49s
feat: setup Gitea Actions CI/CD and Docker configuration
2026-11-21 01:53:02 +07:00

37 lines
704 B
Docker

# Stage 1: Build TypeScript source code
FROM node:22-bookworm-slim AS builder
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm ci
# Copy TypeScript configuration and source
COPY tsconfig.json ./
COPY index.ts ./
# Compile to JavaScript (dist/)
RUN npm run build
# Stage 2: Production runtime image
FROM node:22-bookworm-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
# Install only production dependencies
COPY package*.json ./
RUN npm ci --omit=dev && npm cache clean --force
# Copy compiled code from builder
COPY --from=builder /app/dist ./dist
# Create auth folder for persistent WhatsApp credentials
RUN mkdir -p /app/auth
VOLUME ["/app/auth"]
CMD ["npm", "start"]