fix: copy top_leagues config files to Docker image and fix port mapping
Deploy Iddaai Backend / build-and-deploy (push) Failing after 4s

This commit is contained in:
2026-04-16 09:08:58 +03:00
parent 117a3c1f96
commit b4173c10bb
2 changed files with 60 additions and 1 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ jobs:
--name iddaai-be \
--restart unless-stopped \
--network iddaai_iddaai-network \
-p 127.0.0.1:1810:3000 \
-p 127.0.0.1:1810:3005 \
-e NODE_ENV=production \
-e DATABASE_URL='postgresql://iddaai_user:IddaA1_S4crET!@iddaai-postgres:5432/iddaai_db?schema=public' \
-e REDIS_HOST='iddaai-redis' \
Executable
+59
View File
@@ -0,0 +1,59 @@
# Build stage
FROM node:20-alpine AS builder
# Add build tools for native canvas compilation (fixes 16k page size issues on RPi5 ARM64)
RUN apk add --no-cache python3 make g++ cairo-dev pango-dev jpeg-dev giflib-dev librsvg-dev
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy source code
COPY . .
# Generate Prisma client
RUN npx prisma generate
# Build the application
RUN npm run build
# Production stage
FROM node:20-alpine AS production
# Add runtime dependencies for canvas & prisma
RUN apk add --no-cache cairo pango jpeg giflib librsvg openssl
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install production dependencies only (with build tools for canvas)
RUN apk add --no-cache --virtual .build-deps python3 make g++ cairo-dev pango-dev jpeg-dev giflib-dev librsvg-dev \
&& npm ci --omit=dev --build-from-source=canvas \
&& apk del .build-deps
# Copy Prisma schema and generate client
COPY prisma ./prisma
RUN npx prisma generate
# Copy built application
COPY --from=builder /app/dist ./dist
# Copy i18n files
COPY --from=builder /app/src/i18n ./dist/i18n
# Copy league filter config files (critical: without these, feeder stores ALL matches)
COPY top_leagues.json basketball_top_leagues.json ./
# Set environment
ENV NODE_ENV=production
# Expose port
EXPOSE 3000
# Start the application
CMD ["node", "dist/main.js"]