generated from Yandex-Practicum/go-musthave-shortener-tpl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
76 lines (65 loc) · 1.55 KB
/
docker-compose.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
version: '3.7'
services:
postgres_db:
image: postgres:13.4
restart: always
environment:
- POSTGRES_PASSWORD=jf6y5SfnxsuR
- POSTGRES_USER=urls
- POSTGRES_DB=urls
- PGDATA=/var/lib/postgresql/data/pgdata
ports:
- 5432:5432
volumes:
- pg_data:/var/lib/postgresql/data
migration_db_up:
image: migrate/migrate:v4.16.2
command:
[
"-path", "/migrations",
"-database" , "postgres://urls:[email protected]:5432/urls?sslmode=disable",
"up"
]
volumes:
- ./db/migrations:/migrations
depends_on:
- postgres_db
migration_db_down:
image: migrate/migrate:v4.16.2
command:
[
"-path", "/migrations",
"-database" , "postgres://urls:[email protected]:5432/urls?sslmode=disable",
"down", "-all",
]
volumes:
- ./db/migrations:/migrations
depends_on:
- postgres_db
migration_db_force:
image: migrate/migrate:v4.16.2
command:
[
"-path", "/migrations",
"-database" , "postgres://urls:[email protected]:5432/urls?sslmode=disable",
"force", "3"
]
volumes:
- ./db/migrations:/migrations
depends_on:
- postgres_db
migration_db_add:
image: migrate/migrate:v4.16.2
command:
[
"create",
"-dir", "/migrations",
"-ext", ".sql",
"-seq", "-digits", "5",
"add_url_deleted_flag"
]
volumes:
- ./db/migrations:/migrations
volumes:
pg_data: {}
pg_data2: {}