-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose-test.yaml
More file actions
76 lines (72 loc) · 1.97 KB
/
compose-test.yaml
File metadata and controls
76 lines (72 loc) · 1.97 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
services:
twitter-db:
container_name: twitter-db
image: postgres:16
ports:
- 5433:5432
env_file:
- .env
volumes:
- ./db:/docker-entrypoint-initdb.d/
networks:
- twitter_net
environment:
POSTGRES_USER: ${POSTGRES__USER}
POSTGRES_DB: ${POSTGRES__DB}
POSTGRES_PASSWORD: ${POSTGRES__PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES__USER} -d ${POSTGRES__DB}"]
interval: 5s
timeout: 5s
retries: 5
twitter-red:
container_name: twitter-red
image: redis
networks:
- twitter_net
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 1s
timeout: 3s
retries: 5
twitter-app:
container_name: twitter-app
build:
context: ./app
image: twitter-app
ports:
- 8000:8000
env_file:
- .env
networks:
- twitter_net
depends_on:
twitter-red:
condition: service_healthy
twitter-db:
condition: service_healthy
restart: always
entrypoint: ["bash", "entrypoint.sh"]
test:
container_name: twitter-test
image: twitter-app
env_file:
- .env
networks:
- twitter_net
depends_on:
twitter-red:
condition: service_healthy
twitter-db:
condition: service_healthy
twitter-app:
condition: service_started
entrypoint: ['pytest', '-s', '-v', '--disable-warnings']
healthcheck:
test: curl --fail http://twitter-app:8000/health/ || exit 1
interval: 5s
timeout: 30s
retries: 5
networks:
twitter_net:
name: twitter_net