-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
docker-compose-tests.yml
67 lines (62 loc) · 1.66 KB
/
docker-compose-tests.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
version: "3.9"
services:
db:
container_name: db
image: postgres:15
command: -c 'max_connections=1000'
environment:
- POSTGRES_DB=nakama
- POSTGRES_PASSWORD=localdb
expose:
- "5432"
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "nakama"]
start_period: 10s
interval: 10s
timeout: 10s
retries: 10
nakama:
build:
context: .
dockerfile: ./build/Dockerfile.local
image: nakama-tests
entrypoint:
- "/bin/sh"
- "-ecx"
- >
/nakama/nakama migrate up --database.address postgres:localdb@db:5432/nakama &&
exec /nakama/nakama --logger.level DEBUG --name nakama --database.address postgres:localdb@db:5432/nakama --session.token_expiry_sec 7200 --socket.port 7350 --console.port 7351
restart: always
links:
- "db:db"
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "/nakama/nakama", "healthcheck"]
timeout: 10s
retries: 10
start_period: 5s
interval: 5s
test:
image: "golang:1.23.3"
command: /bin/sh -c "mkdir -p /nakama/internal/gopher-lua/_lua5.1-tests/libs/P1; go test -v -race ./..."
working_dir: "/nakama"
environment:
- "GODEBUG=netdns=cgo"
- TEST_DB_URL=postgresql://postgres:localdb@db:5432/nakama?sslmode=disable
volumes:
- "./:/nakama"
- "lua:/nakama/internal/gopher-lua/_lua5.1-tests/libs"
links:
- "db:db"
depends_on:
db:
condition: service_healthy
nakama:
condition: service_healthy
volumes:
lua:
networks:
default:
driver: bridge