fix(docker): restore mariadb service

Additionally, for now, no-op usage of the MARIADB_SOCKET_DIR
environment variable. This is particularly useful for a serious
production setup, but we don't currently use that.

Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
Kevin Morris 2021-10-25 14:26:22 -07:00
parent 651c1cd8c6
commit 1656f5824d
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
3 changed files with 18 additions and 22 deletions

View file

@ -19,7 +19,6 @@ services:
volumes: volumes:
- ${GIT_DATA_DIR}:/aurweb/aur.git - ${GIT_DATA_DIR}:/aurweb/aur.git
- cache:/cache - cache:/cache
- ${MARIADB_SOCKET_DIR}:/var/run/mysqld
smartgit: smartgit:
restart: always restart: always
@ -42,7 +41,6 @@ services:
restart: always restart: always
volumes: volumes:
- cache:/cache - cache:/cache
- ${MARIADB_SOCKET_DIR}:/var/run/mysqld
fastapi: fastapi:
restart: always restart: always
@ -50,11 +48,6 @@ services:
- FASTAPI_BACKEND="gunicorn" - FASTAPI_BACKEND="gunicorn"
volumes: volumes:
- cache:/cache - cache:/cache
- ${MARIADB_SOCKET_DIR}:/var/run/mysqld
mariadb_init:
volumes:
- ${MARIADB_SOCKET_DIR}:/var/run/mysqld
nginx: nginx:
restart: always restart: always

View file

@ -1,21 +1,6 @@
version: "3.8" version: "3.8"
services: services:
mariadb:
image: aurweb:latest
init: true
entrypoint: /docker/mariadb-entrypoint.sh
command: /usr/bin/mysqld_safe --datadir=/var/lib/mysql
ports:
# This will expose mariadbd on 127.0.0.1:13306 in the host.
# Ex: `mysql -uaur -paur -h 127.0.0.1 -P 13306 aurweb`
- "13306:3306"
volumes:
- mariadb_run:/var/run/mysqld # Bind socket in this volume.
- mariadb_data:/var/lib/mysql
healthcheck:
test: "bash /docker/health/mariadb.sh"
mariadb_init: mariadb_init:
depends_on: depends_on:
mariadb: mariadb:

View file

@ -48,6 +48,21 @@ services:
ports: ports:
- "16379:6379" - "16379:6379"
mariadb:
image: aurweb:latest
init: true
entrypoint: /docker/mariadb-entrypoint.sh
command: /usr/bin/mysqld_safe --datadir=/var/lib/mysql
ports:
# This will expose mariadbd on 127.0.0.1:13306 in the host.
# Ex: `mysql -uaur -paur -h 127.0.0.1 -P 13306 aurweb`
- "13306:3306"
volumes:
- mariadb_run:/var/run/mysqld # Bind socket in this volume.
- mariadb_data:/var/lib/mysql
healthcheck:
test: "bash /docker/health/mariadb.sh"
mariadb_init: mariadb_init:
image: aurweb:latest image: aurweb:latest
init: true init: true
@ -55,6 +70,9 @@ services:
command: echo "MariaDB tables initialized." command: echo "MariaDB tables initialized."
volumes: volumes:
- mariadb_run:/var/run/mysqld - mariadb_run:/var/run/mysqld
depends_on:
mariadb:
condition: service_healthy
git: git:
image: aurweb:latest image: aurweb:latest