-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
93 lines (92 loc) · 2.24 KB
/
docker-compose.yaml
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
services:
# TEST DEVELOPMENT
soundgo_env:
profiles: [dev]
container_name: soundgo_env
tty: true
stdin_open: true
image: soundgo:0.0.1
links:
- db
depends_on:
- db
build:
context: .
volumes:
- .:/usr/src/app
- ~/.cache:/root/.cache/go-build
- ~/go/pkg/mod:/go/pkg/mod
environment:
DB_USER: ${DB_USER}
DB_PORT: ${DB_PORT}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
DB_HOST: ${DB_HOST}
GOOSE_DRIVER: ${GOOSE_DRIVER}
GOOSE_DBSTRING: ${GOOSE_DBSTRING}
JWT_KEY: ${JWT_KEY}
PORT: ${PORT}
AUDIOS_PATH: ${AUDIOS_PATH}
PLAY_COUNT_SAVE_INTERVAL: ${PLAY_COUNT_SAVE_INTERVAL}
ports:
- ${PORT}:${PORT}
- 8080:8080
db:
profiles: [dev]
image: postgres:16-alpine
restart: always
shm_size: 128mb
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
healthcheck:
test: ["CMD-SHELL", "pg_isready -d soundgo -U user"]
interval: 5s
timeout: 60s
# TEST ENVIRONMENT
soundgo_test:
profiles: [test]
container_name: soundgo_test
tty: true
stdin_open: true
image: soundgo:0.0.1
links:
- test_db
depends_on:
- test_db
build:
context: .
volumes:
- .:/usr/src/app
- ~/.cache:/root/.cache/go-build
- ~/go/pkg/mod:/go/pkg/mod
environment:
DB_USER: ${TEST_DB_USER}
DB_PORT: ${TEST_DB_PORT}
DB_PASSWORD: ${TEST_DB_PASSWORD}
DB_NAME: ${TEST_DB_NAME}
DB_HOST: ${TEST_DB_HOST}
GOOSE_DRIVER: ${GOOSE_DRIVER}
GOOSE_DBSTRING: ${TEST_GOOSE_DBSTRING}
JWT_KEY: ${JWT_KEY}
PORT: ${TEST_PORT}
HOST: ${TEST_HOST}
AUDIOS_PATH: ${AUDIOS_PATH}
PLAY_COUNT_SAVE_INTERVAL: ${TEST_PLAY_COUNT_SAVE_INTERVAL}
ports:
- ${TEST_PORT}:${TEST_PORT}
test_db:
profiles: [test]
image: postgres:16-alpine
restart: always
shm_size: 128mb
environment:
POSTGRES_USER: ${TEST_DB_USER}
POSTGRES_PASSWORD: ${TEST_DB_PASSWORD}
POSTGRES_DB: ${TEST_DB_NAME}
healthcheck:
test: ["CMD-SHELL", "pg_isready -d soundgo_test -U user"]
interval: 1s
timeout: 30s
retries: 30