-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
118 lines (113 loc) · 5.02 KB
/
Copy pathdocker-compose.yml
File metadata and controls
118 lines (113 loc) · 5.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
services:
# ─────────────────────────────────────────────
# PostgreSQL (port 5432)
# ─────────────────────────────────────────────
postgres:
image: postgres:16-alpine
container_name: yugoda-postgres
restart: unless-stopped
environment:
POSTGRES_DB: yugoda
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- yugoda-net
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
# ─────────────────────────────────────────────
# Backend (Spring Boot · port 4000)
# ─────────────────────────────────────────────
backend:
build:
context: ./apps/backend
dockerfile: Dockerfile
container_name: yugoda-backend
restart: unless-stopped
ports:
- "4000:4000"
environment:
SERVER_PORT: "4000"
DB_HOST: ${DB_HOST:-postgres}
DB_PORT: ${DB_PORT:-5432}
DB_NAME: ${DB_NAME:-yugoda}
DB_USERNAME: ${DB_USERNAME:-postgres}
DB_PASSWORD: ${DB_PASSWORD:-postgres}
# Allow requests from the browser-facing frontend origin
FRONTEND_URL: "http://localhost:3000"
CORS_ALLOWED_ORIGINS: "http://localhost:3000,http://localhost:3131"
# iyzico — override with real keys for production
IYZICO_API_KEY: ${IYZICO_API_KEY:-dummy}
IYZICO_SECRET_KEY: ${IYZICO_SECRET_KEY:-dummy}
IYZICO_BASE_URL: ${IYZICO_BASE_URL:-https://sandbox-api.iyzipay.com}
# Public URL used in payment callbacks
APP_URL: ${APP_URL:-http://localhost:4000}
# Firebase Admin SDK credentials — three options, first match wins:
# 1. FIREBASE_SERVICE_ACCOUNT_KEY — full service account JSON as one line (set in .env.local)
# 2. GOOGLE_APPLICATION_CREDENTIALS — points to the gcloud ADC file mounted below
# 3. Automatic ADC on GCP Cloud Run — no config needed in production
FIREBASE_SERVICE_ACCOUNT_KEY: ${FIREBASE_SERVICE_ACCOUNT_KEY:-}
FIREBASE_SERVICE_ACCOUNT_PATH: ${FIREBASE_SERVICE_ACCOUNT_PATH:-}
FIREBASE_PROJECT_ID: ${FIREBASE_PROJECT_ID:-yugoda-5b36a}
GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcloud/application_default_credentials.json
# Ollama AI — host.docker.internal reaches the Windows host from inside Docker
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-http://host.docker.internal:11434}
OLLAMA_MODEL: ${OLLAMA_MODEL:-gemma4}
volumes:
# Mount the local gcloud config directory so ADC works inside the container.
# USERPROFILE is a standard Windows shell variable (e.g. C:\Users\Gaming) and is
# always visible to Docker Compose without any .env.local changes.
# Mac/Linux users: export USERPROFILE=$HOME before running docker compose,
# then set GCLOUD_SUBPATH=.config/gcloud in their shell as well.
- ${USERPROFILE}/AppData/Roaming/gcloud:/tmp/gcloud:ro # For Windows
# - ${GCLOUD_CONFIG_DIR:-${HOME}/.config/gcloud}:/tmp/gcloud:ro # For Mac
depends_on:
postgres:
condition: service_healthy
networks:
- yugoda-net
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:4000/health"]
interval: 30s
timeout: 5s
start_period: 30s
retries: 3
# ─────────────────────────────────────────────
# Frontend (React/Vite → Nginx · port 3000)
# ─────────────────────────────────────────────
frontend:
build:
context: ./apps/frontend
dockerfile: Dockerfile
args:
# Baked into the JS bundle at build time.
# The browser reaches the backend directly on the host machine,
# so this must be the host-visible address (localhost:4000).
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:4000/api}
VITE_GOOGLE_MAPS_API_KEY: ${VITE_GOOGLE_MAPS_API_KEY:-}
VITE_GOOGLE_MAPS_MAP_ID: ${VITE_GOOGLE_MAPS_MAP_ID:-}
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
container_name: yugoda-frontend
restart: unless-stopped
ports:
- "3000:80"
depends_on:
backend:
condition: service_healthy
networks:
- yugoda-net
# ─────────────────────────────────────────────
# Volumes & Networks
# ─────────────────────────────────────────────
volumes:
postgres-data:
driver: local
networks:
yugoda-net:
driver: bridge