-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
63 lines (60 loc) · 1.25 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
version: '3.9'
services:
#db-service
db:
image: postgres:15.1-alpine
container_name: postgres_container
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
- DATABASE_HOST=${DB_HOST}
- DATABASE_PORT=${DB_PORT}
ports:
- 5432:5432
hostname: db
volumes:
- pg_data:/var/lib/postgresql/data
networks:
- web-net
#migration_service
migration:
image: migrate/migrate
container_name: migration_container
volumes:
- "./db/migrations:/migrations"
environment:
- DATABASE_URL
env_file:
- .env
command: ["-path=/migrations", "-database=${DATABASE_URL}", "up"]
depends_on:
- db
#restart: on-failure
networks:
- web-net
#backend-web-service
app:
container_name: goweb_container
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME}
- DATABASE_HOST=${DB_HOST}
- DATABASE_PORT=${DB_PORT}
tty: true
build: .
env_file:
- .env
ports:
- 8080:8080
restart: on-failure
depends_on:
- db
networks:
- web-net
volumes:
pg_data:
networks:
web-net:
driver: bridge