-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.ci.yml
80 lines (80 loc) · 2.06 KB
/
docker-compose.ci.yml
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
version: "3.8"
services:
postgres:
image: postgres:16.1-alpine
ports:
- 5432:5432
environment:
- POSTGRES_PASSWORD=postgres
- POSTGRES_USER=postgres
- POSTGRES_DB=postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1s
timeout: 1s
retries: 120
api:
profiles: ["simulations"]
environment:
- THORN_DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable
- THORN_API_HOST=0.0.0.0
- THORN_API_PORT=3001
- THORN_ADMIN_USERNAME=admin
- THORN_ADMIN_PASSWORD=admin
- THORN_ENCRYPTION_KEY=#.9U#JW#XbB12345
- THORN_ENCRYPTION_SECRET=abc&1*~#^2^#s0^=)^^7%b34
- THORN_SIGNING_KEY=secret
- THORN_DEV_MODE=true
- THORN_LOG_LEVEL=info
- THORN_LOG_SINK=none
- THORN_LOG_FORMAT=text
build:
context: .
dockerfile: Dockerfile
target: base
entrypoint: ["/go/bin/api"]
ports:
- 3001:3001
depends_on:
- postgres
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:3001/health || exit 1"]
interval: 1s
timeout: 1s
retries: 60
volumes:
- "./:/app"
simulations:
profiles: ["simulations"]
build:
context: .
dockerfile: Dockerfile
target: simulator
environment:
- THORN_URL=http://api:3001
working_dir: /code
depends_on:
- api
- postgres
command: sh -c "cd simulator && ./simulate.sh"
volumes:
- "./:/code"
tests:
profiles: ["tests"]
build:
context: .
dockerfile: Dockerfile
target: base
environment:
- THORN_DATABASE_URL=postgres://postgres:postgres@postgres:5432/postgres?sslmode=disable
- THORN_ADMIN_USERNAME=admin
- THORN_ADMIN_PASSWORD=admin
- THORN_ENCRYPTION_KEY=#.9U#JW#XbB12345
- THORN_ENCRYPTION_SECRET=abc&1*~#^2^#s0^=)^^7%b34
- THORN_SIGNING_KEY=secret
working_dir: /code
depends_on:
- postgres
command: sh -c "go test ./vault && go test ./api"
volumes:
- "./:/code"