Files
kolaytercih/docker-compose.yml
bilalgursen 4c618781f6
All checks were successful
Deploy / deploy (push) Successful in 7m33s
Docker build'ini optimize et: OOM kökü çözümü + bellek sınırlı builder
Prod VPS'te next build sırasında makineyi kilitleyen OOM'un çözümü:

- serverExternalPackages'a @google/genai, @anthropic-ai/sdk, resend eklendi;
  Turbopack artık genai'nin protobufjs/google-auth-library/ws zincirini
  derlemiyor (c2aba25 sonrası OOM'un tetiği buydu).
- Docker build'inde (BUILD_KAYNAK_KISITLI=1) bellek kısıtları: Turbopack 1.5G
  hedefi, statik üretim tek worker × 4 sayfa, prerender source map kapalı.
- Dockerfile: runner'a tam node_modules kopyası kaldırıldı (imaj ~1.9G→966M),
  pnpm store + .next/cache BuildKit cache mount'ları, açık COPY listesi,
  V8 heap sınırı.
- scripts/standalone-linkleri-onar.sh: Turbopack ESM external'ların kök
  node_modules symlink'ini nft trace'ine yazmıyor; eksik linkler build sonrası
  tamamlanmazsa runtime MODULE_NOT_FOUND ile düşer.
- ci.yaml: build bellek sınırlı buildx docker-container builder'da (2200m,
  max-parallelism 1; BuildKit --memory bayrağını yok sayıyor), deploy
  up -d --no-build ile ayrıldı, temizlik if: always() ile her koşuda.
- compose: app'e mem_limit 1g + oom_score_adj -600.
- Kullanılmayan simple-icons ve @react-pdf/renderer kaldırıldı; npm artığı
  package-lock.json silindi.

Doğrulama: imaj 2 CPU/2GiB VM'de sıfırdan build edildi, konteynerde ana
sayfa/universite 200 ve üç ESM external import OK.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-06 17:20:17 +03:00

33 lines
909 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
app:
build: .
container_name: kolaytercih
restart: unless-stopped
# Host'u korur: uygulama bu sınırın üstüne çıkamaz. OOM anında kernel'ın
# önce build süreçlerini (skor 0) öldürmesi için negatif oom_score_adj.
mem_limit: 1g
mem_reservation: 256m
oom_score_adj: -600
volumes:
- app-data:/app/data
env_file:
- .env.production
environment:
- APP_DB_URL=file:/app/data/app.db
networks:
- traefik
labels:
- traefik.enable=true
- traefik.docker.network=traefik
- traefik.http.routers.kolaytercih.rule=Host(`kolaytercih.com`)
- traefik.http.routers.kolaytercih.entrypoints=websecure
- traefik.http.routers.kolaytercih.tls.certresolver=letsencrypt
- traefik.http.services.kolaytercih.loadbalancer.server.port=3000
networks:
traefik:
external: true
volumes:
app-data: