-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
50 lines (46 loc) · 1.02 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
version: '3.8'
services:
db:
image: postgres:14-alpine
container_name: postgres_db
environment:
- POSTGRES_PASSWORD=secret
- POSTGRES_USER=app-user
- POSTGRES_DB=app_db
ports:
- "5432:5432"
volumes:
- db_data:/var/lib/postgresql/data
migrate:
image: migrate/migrate
container_name: migrations
volumes:
- ./migrations:/migrations
command:
- -path
- /migrations/
- -database
- postgres://app-user:secret@db:5432/app_db?sslmode=disable
- up
depends_on:
- db
app:
image: image-service:latest
container_name: image_api_app
environment:
- HTTP_PORT=8080
- HTTP_ADDR=localhost:8080
- HTTP_TOKEN=secret
- HTTP_SECRET=my-secret
- HTTP_IMAGE_DIR=/images
- DB_DSN=postgres://app-user:secret@db:5432/app_db?sslmode=disable
volumes:
- app_data:/images
ports:
- "8080:8080"
restart: always
depends_on:
- migrate
volumes:
db_data:
app_data: