-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
109 lines (102 loc) · 2.86 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
109 lines (102 loc) · 2.86 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
services:
db:
image: postgres:18-alpine
environment:
POSTGRES_USER: spacescale
POSTGRES_PASSWORD: spacescale
POSTGRES_DB: postgres
PGDATA: /var/lib/postgresql/18/docker
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/18/docker
- ./control/db/init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U spacescale -d postgres" ]
interval: 5s
timeout: 5s
retries: 20
nats:
image: nats:2.14.3-alpine
command: [ "-js", "-m", "8222", "-sd", "/data" ]
ports:
- "0.0.0.0:4222:4222"
- "0.0.0.0:8222:8222"
volumes:
- natsdata:/data
migrate:
image: golang:1.26
working_dir: /workspace
volumes:
- .:/workspace
- gomodcache:/go/pkg/mod
- gobuildcache:/root/.cache/go-build
environment:
DATABASE_URL: postgres://spacescale:spacescale@db:5432/spacescale?sslmode=disable
depends_on:
db:
condition: service_healthy
command:
- sh
- -c
- go run github.com/pressly/goose/v3/cmd/goose@v3.25.0 -dir control/db/migrations postgres "$$DATABASE_URL" up
restart: "no"
controlp:
image: golang:1.26
working_dir: /workspace
volumes:
- .:/workspace
- gomodcache:/go/pkg/mod
- gobuildcache:/root/.cache/go-build
environment:
ENVIRONMENT: development
NATS_URL: nats://nats:4222
DATABASE_URL: postgres://spacescale:spacescale@db:5432/spacescale?sslmode=disable
WORKOS_API_KEY: ${WORKOS_API_KEY}
WORKOS_CLIENT_ID: ${WORKOS_CLIENT_ID}
WORKOS_COOKIE_PASSWORD: ${WORKOS_COOKIE_PASSWORD}
WORKOS_REDIRECT_URI: http://localhost:8080/auth/callback
WORKOS_POST_LOGIN_REDIRECT_URI: http://localhost:8080/healthz
WORKOS_LOGOUT_REDIRECT_URI: http://localhost:8080/healthz
API_ENV_ENCRYPTION_KEY_ID: dev-key
API_ENV_ENCRYPTION_KEY: AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8=
depends_on:
db:
condition: service_healthy
nats:
condition: service_started
migrate:
condition: service_completed_successfully
ports:
- "8080:8080"
command:
- go
- run
- ./cmd/controlp
coverage:
image: golang:1.26
working_dir: /workspace
volumes:
- .:/workspace
- gomodcache:/go/pkg/mod
- gobuildcache:/root/.cache/go-build
environment:
HOME: /root
GOPATH: /go
GOCACHE: /root/.cache/go-build
GOMODCACHE: /go/pkg/mod
TEST_DATABASE_URL: postgres://spacescale:spacescale@db:5432/spacescale?sslmode=disable
depends_on:
db:
condition: service_healthy
migrate:
condition: service_completed_successfully
command:
- sh
- -lc
- /usr/local/go/bin/go test ./... -coverprofile=coverage.out
volumes:
pgdata:
natsdata:
gomodcache:
gobuildcache: