-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
112 lines (106 loc) · 2.83 KB
/
Copy pathdocker-compose.yml
File metadata and controls
112 lines (106 loc) · 2.83 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
services:
postgres:
image: postgres:15-alpine
container_name: resellio_postgres
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
db-init:
build:
context: ./backend/db_init
container_name: resellio_db_init
environment:
- DB_HOST=postgres
- DB_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- PGPASSWORD=${DB_PASSWORD}
- DB_RESET=true
depends_on:
postgres:
condition: service_healthy
auth-service:
build:
context: ./backend/user_auth_service
container_name: resellio_auth_service
ports:
- "8000:8000"
environment:
- DB_URL=postgres
- DB_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- SECRET_KEY=${SECRET_KEY}
- ADMIN_SECRET_KEY=${ADMIN_SECRET_KEY}
- EMAIL_API_KEY=${EMAIL_API_KEY}
- EMAIL_FROM_EMAIL=${EMAIL_FROM_EMAIL}
- APP_BASE_URL=${APP_BASE_URL}
depends_on:
db-init:
condition: service_completed_successfully
events-service:
build:
context: ./backend/event_ticketing_service
container_name: resellio_events_service
ports:
- "8001:8001"
environment:
- DB_URL=postgres
- DB_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- SECRET_KEY=${SECRET_KEY}
- EMAIL_API_KEY=${EMAIL_API_KEY}
- EMAIL_FROM_EMAIL=${EMAIL_FROM_EMAIL}
- APP_BASE_URL=${APP_BASE_URL}
depends_on:
db-init:
condition: service_completed_successfully
api-gateway:
build:
context: ./backend/api_gateway
container_name: resellio_api_gateway
ports:
- "8080:80"
volumes:
- ./backend/api_gateway/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- auth-service
- events-service
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
flutter-tester:
profiles:
- tests
build:
context: ./frontend
dockerfile: test.Dockerfile
container_name: resellio_flutter_tester
environment:
# This URL is used by the command to pass the correct backend address to the tests
- API_BASE_URL=http://api-gateway/api
depends_on:
api-gateway:
condition: service_healthy
command: >
sh -c "
echo '--- Running Flutter tests ---' &&
flutter test --dart-define=API_BASE_URL=$${API_BASE_URL}
"
volumes:
postgres-data: