-
Notifications
You must be signed in to change notification settings - Fork 10
/
docker-compose.yml
executable file
·64 lines (64 loc) · 1.5 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
version: "3.7"
services:
db:
image: "mariadb:10.7.3"
ports:
- 3306:3306
volumes:
- db:/var/lib/mysql
environment:
MARIADB_ROOT_PASSWORD: "db"
MARIADB_DATABASE: "iptvhandler"
MARIADB_USER: "db"
MARIADB_PASSWORD: "db"
logging:
driver: none
networks:
- iptvhandler
healthcheck:
test: "mysql iptvhandler -udb -pdb -e 'SELECT 1;' || exit 1"
start_period: 1s
interval: 1s
timeout: 1s
retries: 30
migration:
build:
context: .
dockerfile: Dockerfile.migrations
command: >
bash -c "sqlx database reset -y &&
cargo sqlx prepare -- --lib"
networks:
- iptvhandler
env_file: ./.env
environment:
CARGO_TARGET_DIR: "/tmp/target" # VirtioFS files not found fix
volumes:
- ./src:/usr/src/app
depends_on:
db:
condition: service_healthy
server:
build:
context: .
dockerfile: Dockerfile.develop
command: cargo watch --delay 4 --why -x run
tty: true # color terminal output
environment:
RUST_LOG: "info" # example: warn,server=info,iptv=info,api=debug,rest-client=debug,db=info
CARGO_TARGET_DIR: "/tmp/target" # VirtioFS files not found fix
ports:
- "3001:3001"
volumes:
- ./src:/usr/src/app
env_file: ./.env
networks:
- iptvhandler
depends_on:
migration:
condition: "service_completed_successfully"
volumes:
db:
networks:
iptvhandler:
name: iptvhandler