forked from GDGVIT/fanfiction-writer-backend
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
61 lines (55 loc) · 1.32 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
version: '3.8'
services:
api:
build: .
ports:
- 4000:4000
# volumes:zi
# - .:/usr/src/app
# command: >
# sh -c "go run ./cmd/api/ --db-dsn=postgres://ffwriter:password@localhost/FF-Writer?sslmode=disable
# env_file:
# - ./fanfiction-backend/.envrc
# links:
# - db
environment:
- DB_HOST=db
- DB_USER=ffwriter
- DB_PASSWORD=password
- DB_NAME=FF-Writer
- DB_PORT=5432
- ENV="production"
depends_on:
- db
- migrate
networks:
- ffwriter-network
db:
image: postgres
environment:
- POSTGRES_USER=ffwriter
- POSTGRES_PASSWORD=password
- POSTGRES_DB=FF-Writer
ports:
- 5432:5432
volumes:
- postgres-db:/var/lib/postgresql/data
networks:
- ffwriter-network
migrate:
image: migrate/migrate
depends_on:
- db
volumes:
- ./fanfiction-backend/migrations:/migrations
# entrypoint: "migrate -database postgres://ffwriter:password@db:5432/FF-Writer?sslmode=disable -path /migrations"
# command: up
command: ["-path", "/migrations", "-database", "postgres://ffwriter:password@db:5432/FF-Writer?sslmode=disable", "up"]
links:
- db
networks:
- ffwriter-network
volumes:
postgres-db:
networks:
ffwriter-network: