-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
50 lines (48 loc) · 1.09 KB
/
docker-compose.yaml
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
services:
db:
container_name: movies-db
image: postgres
volumes:
- type: bind
source: docker/data
target: /var/lib/postgresql/data
read_only: false
- type: bind
source: docker/postgres/init-db.sql
target: /docker-entrypoint-initdb.d/init-db.sql
read_only: true
ports:
- 5432:5432
environment:
POSTGRES_PASSWORD: goLANGninja
migrations:
container_name: movies-app-migrations
image: migrate/migrate
volumes:
- ./docker/migrations:/migrations
command:
- -path=/migrations/
- -database=postgres://postgres:goLANGninja@db:5432/movies?sslmode=disable
- up
restart: on-failure
depends_on:
- db
movies-app:
container_name: movies-app
build:
context: .
dockerfile: docker/Dockerfile
ports:
- 8080:8080
environment:
PORT: 8080
DB_HOST: db
DB_PORT: 5432
DB_USER: postgres
DB_PASS: goLANGninja
DB_NAME: movies
SSL_MODE: false
restart: on-failure
depends_on:
- db
- migrations