mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(docker): fix compose race conditions on mariadb_init
We want the dependent services to wait until the initialization service of mariadb finishes, but also properly accept if it already exited before a leaf service gets picked up and put into created state. By using the service_completed_successfully signal, we can ensure precisely this, without being racy and leading to none booted services. While at it, remove the compose version identifiers as docker-compose deprecated them and always warned about when running docker-compose.
This commit is contained in:
parent
88e8db4404
commit
8dcf0b2d97
3 changed files with 18 additions and 16 deletions
|
@ -1,5 +1,4 @@
|
|||
version: "3.8"
|
||||
|
||||
---
|
||||
services:
|
||||
ca:
|
||||
volumes:
|
||||
|
|
|
@ -1,16 +1,10 @@
|
|||
version: "3.8"
|
||||
|
||||
---
|
||||
services:
|
||||
ca:
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- step:/root/.step
|
||||
|
||||
mariadb_init:
|
||||
depends_on:
|
||||
mariadb:
|
||||
condition: service_healthy
|
||||
|
||||
git:
|
||||
volumes:
|
||||
- git_data:/aurweb/aur.git
|
||||
|
@ -21,9 +15,6 @@ services:
|
|||
- git_data:/aurweb/aur.git
|
||||
- ./data:/data
|
||||
- smartgit_run:/var/run/smartgit
|
||||
depends_on:
|
||||
mariadb:
|
||||
condition: service_healthy
|
||||
|
||||
fastapi:
|
||||
volumes:
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
#
|
||||
# Docker service definitions for the aurweb project.
|
||||
#
|
||||
|
@ -16,8 +17,6 @@
|
|||
#
|
||||
# Copyright (C) 2021 aurweb Development
|
||||
# All Rights Reserved.
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
aurweb-image:
|
||||
build: .
|
||||
|
@ -107,8 +106,10 @@ services:
|
|||
test: "bash /docker/health/sshd.sh"
|
||||
interval: 3s
|
||||
depends_on:
|
||||
mariadb:
|
||||
condition: service_healthy
|
||||
mariadb_init:
|
||||
condition: service_started
|
||||
condition: service_completed_successfully
|
||||
volumes:
|
||||
- mariadb_run:/var/run/mysqld
|
||||
|
||||
|
@ -122,6 +123,9 @@ services:
|
|||
healthcheck:
|
||||
test: "bash /docker/health/smartgit.sh"
|
||||
interval: 3s
|
||||
depends_on:
|
||||
mariadb:
|
||||
condition: service_healthy
|
||||
|
||||
cgit-fastapi:
|
||||
image: aurweb:latest
|
||||
|
@ -152,8 +156,10 @@ services:
|
|||
entrypoint: /docker/cron-entrypoint.sh
|
||||
command: /docker/scripts/run-cron.sh
|
||||
depends_on:
|
||||
mariadb:
|
||||
condition: service_healthy
|
||||
mariadb_init:
|
||||
condition: service_started
|
||||
condition: service_completed_successfully
|
||||
volumes:
|
||||
- ./aurweb:/aurweb/aurweb
|
||||
- mariadb_run:/var/run/mysqld
|
||||
|
@ -182,6 +188,12 @@ services:
|
|||
condition: service_healthy
|
||||
cron:
|
||||
condition: service_started
|
||||
mariadb:
|
||||
condition: service_healthy
|
||||
mariadb_init:
|
||||
condition: service_completed_successfully
|
||||
tempo:
|
||||
condition: service_healthy
|
||||
volumes:
|
||||
- archives:/var/lib/aurweb/archives
|
||||
- mariadb_run:/var/run/mysqld
|
||||
|
|
Loading…
Add table
Reference in a new issue