-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathdocker-compose.dev.yaml
More file actions
37 lines (36 loc) · 1.2 KB
/
docker-compose.dev.yaml
File metadata and controls
37 lines (36 loc) · 1.2 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
name: riverui-dev
services:
postgres:
image: "postgres:18.3-alpine@sha256:54451ecb8ab38c24c3ec123f2fd501303a3a1856a5c66e98cecf2460d5e1e9d7"
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: ["CMD", "pg_isready", "-d", "river_dev", "-U", "postgres"]
timeout: 20s
retries: 10
start_period: 3s
volumes:
- ./scripts/docker-compose-dev/postgres/init:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
migrate:
image: "golang:1.25.10-alpine@sha256:8d22e29d960bc50cd025d93d5b7c7d220b1ee9aa7a239b3c8f55a57e987e8d45"
depends_on:
postgres:
condition: "service_healthy"
entrypoint: "/bin/sh"
# cache the go binaries so they don't redownload
volumes:
- gopath:/go
command:
- -c
- |
echo "downloading river binary"
go install github.com/riverqueue/river/cmd/river@latest
echo "migrating river_dev database"
river migrate-up --database-url "postgres://postgres:postgres@postgres/river_dev"
echo "migrating river_test database"
river migrate-up --database-url "postgres://postgres:postgres@postgres/river_test"
volumes:
gopath: