-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
126 lines (116 loc) · 2.65 KB
/
Copy pathdocker-compose.yml
File metadata and controls
126 lines (116 loc) · 2.65 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
119
120
121
122
123
124
125
126
services:
mercury_api:
restart: always
image: mercury_api:latest
build:
context: .
dockerfile: ./Dockerfile
target: api
env_file:
- .env
ports:
- "8000:8000"
networks:
- mercury_api
depends_on:
mercury_cache:
condition: service_healthy
mercury_db:
condition: service_healthy
mercury_migrate:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/v1/health')"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
mercury_cache:
image: redis:7-alpine
restart: always
container_name: mercury_cache
networks:
- mercury_api
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
mercury_migrate:
image: flyway/flyway:${FLYWAYDB_VERSION:-10-alpine}
container_name: mercury_migrate
volumes:
- ./src/migrations:/flyway/sql
- ./flyway.conf:/flyway/conf/flyway.conf
environment:
- FLYWAY_URL=jdbc:postgresql://${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
- FLYWAY_USER=${POSTGRES_USER}
- FLYWAY_PASSWORD=${POSTGRES_PASSWORD}
command: migrate
depends_on:
mercury_db:
condition: service_healthy
networks:
- mercury_api
mercury_db:
image: postgres:16-alpine
container_name: mercury_db
ports:
- "5432:5432"
restart: always
volumes:
- mercurydb:/var/lib/postgresql/data
env_file:
- .env
networks:
- mercury_api
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
mercury_integration_tests:
build:
context: .
dockerfile: ./Dockerfile
target: integration_tests
env_file:
- .env
depends_on:
mercury_db:
condition: service_healthy
mercury_cache:
condition: service_healthy
mercury_migrate:
condition: service_completed_successfully
networks:
- mercury_api
mercury_unit_tests:
build:
context: .
dockerfile: ./Dockerfile
target: unit_tests
env_file:
- .env
mercury_linter:
build:
context: .
dockerfile: ./Dockerfile
target: linter
env_file:
- .env
mercury_security:
build:
context: .
dockerfile: ./Dockerfile
target: code_scanner
volumes:
- .:/app
env_file:
- .env
volumes:
mercurydb:
networks:
mercury_api:
driver: bridge