Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
aurweb
Commits
1cb1ce0d
Commit
1cb1ce0d
authored
Oct 19, 2021
by
Steven Guikal
Browse files
feat(docker): allow production docker setup to use dedicated mariadb
Signed-off-by:
Steven Guikal
<
void@fluix.one
>
parent
4e3cc1df
Changes
4
Hide whitespace changes
Inline
Side-by-side
.env
View file @
1cb1ce0d
FASTAPI_BACKEND="uvicorn"
FASTAPI_WORKERS=2
MARIADB_SOCKET_DIR="/var/run/mysqld/"
docker-compose.override.yml
View file @
1cb1ce0d
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
:
depends_on
:
mariadb
:
condition
:
service_healthy
ca
:
volumes
:
-
./cache:/cache
...
...
@@ -13,6 +33,9 @@ services:
-
git_data:/aurweb/aur.git
-
./cache:/cache
-
smartgit_run:/var/run/smartgit
depends_on
:
mariadb
:
condition
:
service_healthy
php-fpm
:
volumes
:
...
...
docker-compose.prod.yml
View file @
1cb1ce0d
...
...
@@ -9,6 +9,7 @@ services:
volumes
:
-
git_data:/aurweb/aur.git
-
cache:/cache
-
${MARIADB_SOCKET_DIR}:/var/run/mysqld
smartgit
:
volumes
:
...
...
@@ -19,12 +20,18 @@ services:
php-fpm
:
volumes
:
-
cache:/cache
-
${MARIADB_SOCKET_DIR}:/var/run/mysqld
fastapi
:
environment
:
-
FASTAPI_BACKEND="gunicorn"
volumes
:
-
cache:/cache
-
${MARIADB_SOCKET_DIR}:/var/run/mysqld
mariadb_init
:
volumes
:
-
${MARIADB_SOCKET_DIR}:/var/run/mysqld
nginx
:
volumes
:
...
...
@@ -34,7 +41,7 @@ services:
-
smartgit_run:/var/run/smartgit
volumes
:
mariadb_run
:
{}
# Share /var/run/mysqld
/mysqld.sock
mariadb_run
:
{}
# Share /var/run/mysqld
mariadb_data
:
{}
# Share /var/lib/mysql
git_data
:
{}
# Share aurweb/aur.git
smartgit_run
:
{}
...
...
docker-compose.yml
View file @
1cb1ce0d
...
...
@@ -48,29 +48,11 @@ services:
ports
:
-
"
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
:
image
:
aurweb:latest
init
:
true
entrypoint
:
/docker/mariadb-init-entrypoint.sh
command
:
echo "MariaDB tables initialized."
depends_on
:
mariadb
:
condition
:
service_healthy
volumes
:
-
mariadb_run:/var/run/mysqld
...
...
@@ -100,9 +82,6 @@ services:
command
:
/docker/scripts/run-smartgit.sh
healthcheck
:
test
:
"
bash
/docker/health/smartgit.sh"
depends_on
:
mariadb
:
condition
:
service_healthy
cgit-php
:
image
:
aurweb:latest
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment