mirror of
https://github.com/nethunterzist/trendyol-analiz
synced 2026-07-01 01:17:04 +00:00
Traefik defaults to port 80 when no loadbalancer port is specified. Backend listens on 8001, causing the trendyol-api domain to timeout. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
116 lines
2.6 KiB
YAML
116 lines
2.6 KiB
YAML
name: trendyol-analiz
|
|
|
|
services:
|
|
# ============================================
|
|
# PostgreSQL Database
|
|
# ============================================
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
restart: unless-stopped
|
|
|
|
environment:
|
|
POSTGRES_DB: trendyol_db
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: trendyol123
|
|
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
networks:
|
|
- trendyol-network
|
|
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# ============================================
|
|
# Backend Service (FastAPI + PostgreSQL)
|
|
# ============================================
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: backend/Dockerfile
|
|
restart: unless-stopped
|
|
|
|
ports:
|
|
- "8010:8001"
|
|
|
|
labels:
|
|
- "traefik.http.services.backend.loadbalancer.server.port=8001"
|
|
|
|
environment:
|
|
# Python environment
|
|
PYTHONUNBUFFERED: 1
|
|
|
|
# PostgreSQL Database
|
|
DATABASE_URL: postgresql://postgres:trendyol123@postgres:5432/trendyol_db
|
|
|
|
# Storage paths (Docker volumes)
|
|
CATEGORIES_DIR: /data/categories
|
|
REPORTS_DIR: /data/reports
|
|
|
|
# CORS configuration (allow frontend container)
|
|
FRONTEND_URL: http://trendyol.194.187.253.230.sslip.io
|
|
|
|
volumes:
|
|
# Persistent data volumes (reports persist across deploys)
|
|
- ./reports:/data/reports
|
|
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
networks:
|
|
- trendyol-network
|
|
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
start_period: 40s
|
|
retries: 5
|
|
|
|
# ============================================
|
|
# Frontend Service (React + Nginx)
|
|
# ============================================
|
|
frontend:
|
|
build:
|
|
context: ./admin-panel
|
|
dockerfile: Dockerfile
|
|
args:
|
|
# Backend API URL via Coolify Traefik proxy
|
|
VITE_API_URL: http://trendyol-api.194.187.253.230.sslip.io
|
|
restart: unless-stopped
|
|
|
|
ports:
|
|
- "3010:80"
|
|
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
|
|
networks:
|
|
- trendyol-network
|
|
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1/"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
start_period: 5s
|
|
retries: 3
|
|
|
|
# ============================================
|
|
# Networks
|
|
# ============================================
|
|
networks:
|
|
trendyol-network:
|
|
driver: bridge
|
|
|
|
# ============================================
|
|
# Volumes
|
|
# ============================================
|
|
volumes:
|
|
postgres_data:
|