-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dist.yaml
More file actions
52 lines (49 loc) · 1.15 KB
/
docker-compose.dist.yaml
File metadata and controls
52 lines (49 loc) · 1.15 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
services:
test:
build:
context: .
dockerfile: Dockerfile
target: "go-test"
command: [ "go", "test", "-v", "./..." ]
environment:
- DB_HOST=test-db:5432
- DB_USER_FILE=/run/secrets/test-db-user
- DB_PASSWORD_FILE=/run/secrets/test-db-password
depends_on:
test-db:
condition: service_healthy
external_links:
- test-db:test-db
networks:
- test
secrets:
- test-db-user
- test-db-password
test-db:
image: postgres:16-alpine
environment:
- PGDATA=/var/lib/postgresql/data/pgdata
- POSTGRES_USER_FILE=/run/secrets/test-db-user
- POSTGRES_PASSWORD_FILE=/run/secrets/test-db-password
expose:
- "5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
networks:
- test
secrets:
- test-db-user
- test-db-password
user: ${DOCKER_USER}
volumes:
- ./data/test-db/data:/var/lib/postgresql/data
networks:
test:
secrets:
test-db-user:
file: docker/test-db/secrets/user
test-db-password:
file: docker/test-db/secrets/password