mirror of
https://codeberg.org/catask-org/catask.git
synced 2025-04-19 21:33:41 -05:00
add healthcheck to mariadb container
wait until mariadb is fully started when starting catask container remove custom networks in docker compose
This commit is contained in:
parent
0a3e4760bc
commit
803c97fc61
1 changed files with 8 additions and 11 deletions
|
@ -7,9 +7,13 @@ services:
|
||||||
MARIADB_DATABASE: catask
|
MARIADB_DATABASE: catask
|
||||||
MARIADB_USER: catask
|
MARIADB_USER: catask
|
||||||
MARIADB_PASSWORD: catask
|
MARIADB_PASSWORD: catask
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||||
|
start_period: 10s
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
image: mariadb
|
image: mariadb
|
||||||
networks:
|
|
||||||
- catask
|
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ./schema.sql:/docker-entrypoint-initdb.d/1.sql
|
- ./schema.sql:/docker-entrypoint-initdb.d/1.sql
|
||||||
|
@ -19,9 +23,8 @@ services:
|
||||||
build:
|
build:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
depends_on:
|
depends_on:
|
||||||
- mariadb
|
mariadb:
|
||||||
networks:
|
condition: service_healthy
|
||||||
- catask
|
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -32,11 +35,5 @@ services:
|
||||||
source: ./.env
|
source: ./.env
|
||||||
target: /catask/.env
|
target: /catask/.env
|
||||||
|
|
||||||
networks:
|
|
||||||
catask:
|
|
||||||
driver: bridge
|
|
||||||
driver_opts:
|
|
||||||
com.docker.network.bridge.host_binding_ipv4: "127.0.0.1"
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db-data:
|
db-data:
|
Loading…
Add table
Reference in a new issue