-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (87 loc) · 3.28 KB
/
Copy pathdocker-compose.yml
File metadata and controls
92 lines (87 loc) · 3.28 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
services:
# ─── PostgreSQL ──────────────────────────────────────────────────────────────
postgres:
image: postgres:16-alpine
container_name: expertech-cv-postgres
restart: unless-stopped
environment:
POSTGRES_USER: expertech
POSTGRES_PASSWORD: devpassword
POSTGRES_DB: expertech_cv_dev
volumes:
- expertech_pg_data:/var/lib/postgresql/data
# Port exposed to host for local debugging (e.g. Prisma Studio).
# Port 5435 avoids collisions with other local PG instances.
ports:
- "5435:5432"
networks:
- expertech_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U expertech -d expertech_cv_dev"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
# ─── Backend API ─────────────────────────────────────────────────────────────
api:
build:
context: ./apps/api
dockerfile: Dockerfile
container_name: expertech-cv-api
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
environment:
PORT: 3002
# Uses internal Docker network hostname, not localhost.
DATABASE_URL: postgresql://expertech:devpassword@postgres:5432/expertech_cv_dev?schema=public
# 8090 = Nginx proxy (prod-like). 5173/5174 = Vite dev server (mixed mode).
ALLOWED_ORIGINS: http://localhost:8090,http://127.0.0.1:8090,http://localhost:5173,http://localhost:5174
JOOBLE_API_KEY: YOUR_REAL_KEY_HERE
# Port exposed to host for direct API access during development.
ports:
- "3002:3002"
networks:
- expertech_network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3002/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
# ─── Frontend (Nginx) ─────────────────────────────────────────────────────────
web:
build:
context: ./apps/web
dockerfile: Dockerfile
args:
VITE_API_URL: /api
container_name: expertech-cv-web
restart: unless-stopped
depends_on:
api:
condition: service_healthy
# 8090 in host to avoid collision with other containers on 8080
# (e.g. rusteze-pgadmin-1). Standard port 8080 documented in README.
ports:
- "8090:80"
networks:
- expertech_network
healthcheck:
# Use 127.0.0.1 explicitly — Alpine's localhost resolves to ::1 (IPv6)
# but nginx:alpine only listens on IPv4.
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1/"]
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
networks:
expertech_network:
name: expertech_network
volumes:
# Mark as external so Docker Compose reuses the existing volume created
# by apps/api/docker-compose.yml during Fase 6 development. Remove
# `external: true` and add `name:` if you prefer a fresh volume.
expertech_pg_data:
external: true