-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
110 lines (103 loc) · 2.96 KB
/
Copy pathdocker-compose.yml
File metadata and controls
110 lines (103 loc) · 2.96 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
# ============================================================================
# DEVELOPMENT ONLY - Do not use these credentials in production!
# ============================================================================
services:
postgres:
image: postgres:15-alpine
container_name: arfa-postgres
environment:
POSTGRES_DB: arfa
POSTGRES_USER: arfa
# ⚠️ DEVELOPMENT ONLY - Change in production!
POSTGRES_PASSWORD: arfa_dev_password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./platform/database/schema.sql:/docker-entrypoint-initdb.d/01-schema.sql
# Seeds are opt-in: use docker-compose.dev.yml for demo data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U arfa"]
interval: 5s
timeout: 5s
retries: 5
adminer:
image: adminer:latest
container_name: arfa-adminer
ports:
- "8081:8080"
environment:
ADMINER_DEFAULT_SERVER: postgres
depends_on:
- postgres
# API Server
api:
build:
context: .
dockerfile: services/api/Dockerfile
target: development
container_name: arfa-api
ports:
- "8080:8080"
environment:
DATABASE_URL: postgres://arfa:arfa_dev_password@postgres:5432/arfa?sslmode=disable
# ⚠️ DEVELOPMENT ONLY - Generate a secure secret for production!
# Use: openssl rand -base64 32
JWT_SECRET: dev_secret_change_in_production
PORT: 8080
depends_on:
postgres:
condition: service_healthy
# Web UI
web:
build:
context: ./services/web
dockerfile: Dockerfile
target: development
container_name: arfa-web
ports:
- "3000:3000"
environment:
# Server-side API URL (uses Docker network hostname)
API_URL: http://arfa-api:8080/api/v1
# Client-side API URL (uses host localhost)
NEXT_PUBLIC_API_URL: http://localhost:8080/api/v1
NODE_ENV: development
volumes:
# Mount source code for hot reload
- ./services/web:/app
- /app/node_modules
- /app/.next
depends_on:
- api
# Elasticsearch for log analytics
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
container_name: arfa-elasticsearch
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ports:
- "9200:9200"
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 5s
retries: 10
# Kibana for log visualization
kibana:
image: docker.elastic.co/kibana/kibana:8.11.0
container_name: arfa-kibana
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ports:
- "5601:5601"
depends_on:
elasticsearch:
condition: service_healthy
volumes:
postgres_data:
elasticsearch_data: