mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(docker): only use mariadb socket for connections
This commit is contained in:
parent
37232f71ee
commit
4e3cc1dfe2
7 changed files with 13 additions and 56 deletions
|
@ -10,12 +10,12 @@
|
||||||
backend = mysql
|
backend = mysql
|
||||||
|
|
||||||
; If using sqlite, set name to the database file path.
|
; If using sqlite, set name to the database file path.
|
||||||
name = aurweb_test
|
name = aurweb
|
||||||
|
|
||||||
; MySQL database information. User defaults to root for containerized
|
; MySQL database information. User defaults to root for containerized
|
||||||
; testing with mysqldb. This should be set to a non-root user.
|
; testing with mysqldb. This should be set to a non-root user.
|
||||||
user = root
|
user = aur
|
||||||
;password = non-root-user-password
|
password = aur
|
||||||
host = localhost
|
host = localhost
|
||||||
;port = 3306
|
;port = 3306
|
||||||
socket = /var/run/mysqld/mysqld.sock
|
socket = /var/run/mysqld/mysqld.sock
|
||||||
|
|
|
@ -66,20 +66,19 @@ services:
|
||||||
mariadb_init:
|
mariadb_init:
|
||||||
image: aurweb:latest
|
image: aurweb:latest
|
||||||
init: true
|
init: true
|
||||||
environment:
|
|
||||||
- DB_HOST=mariadb
|
|
||||||
entrypoint: /docker/mariadb-init-entrypoint.sh
|
entrypoint: /docker/mariadb-init-entrypoint.sh
|
||||||
command: echo "MariaDB tables initialized."
|
command: echo "MariaDB tables initialized."
|
||||||
depends_on:
|
depends_on:
|
||||||
mariadb:
|
mariadb:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
volumes:
|
||||||
|
- mariadb_run:/var/run/mysqld
|
||||||
|
|
||||||
git:
|
git:
|
||||||
image: aurweb:latest
|
image: aurweb:latest
|
||||||
init: true
|
init: true
|
||||||
environment:
|
environment:
|
||||||
- AUR_CONFIG=/aurweb/conf/config
|
- AUR_CONFIG=/aurweb/conf/config
|
||||||
- DB_HOST=mariadb
|
|
||||||
entrypoint: /docker/git-entrypoint.sh
|
entrypoint: /docker/git-entrypoint.sh
|
||||||
command: /docker/scripts/run-sshd.sh
|
command: /docker/scripts/run-sshd.sh
|
||||||
ports:
|
ports:
|
||||||
|
@ -89,6 +88,8 @@ services:
|
||||||
depends_on:
|
depends_on:
|
||||||
mariadb_init:
|
mariadb_init:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
|
volumes:
|
||||||
|
- mariadb_run:/var/run/mysqld
|
||||||
|
|
||||||
smartgit:
|
smartgit:
|
||||||
image: aurweb:latest
|
image: aurweb:latest
|
||||||
|
@ -138,7 +139,6 @@ services:
|
||||||
init: true
|
init: true
|
||||||
environment:
|
environment:
|
||||||
- AUR_CONFIG=/aurweb/conf/config
|
- AUR_CONFIG=/aurweb/conf/config
|
||||||
- DB_HOST=mariadb
|
|
||||||
entrypoint: /docker/php-entrypoint.sh
|
entrypoint: /docker/php-entrypoint.sh
|
||||||
command: /docker/scripts/run-php.sh
|
command: /docker/scripts/run-php.sh
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
@ -150,6 +150,8 @@ services:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
memcached:
|
memcached:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
volumes:
|
||||||
|
- mariadb_run:/var/run/mysqld
|
||||||
ports:
|
ports:
|
||||||
- "19000:9000"
|
- "19000:9000"
|
||||||
|
|
||||||
|
@ -158,7 +160,6 @@ services:
|
||||||
init: true
|
init: true
|
||||||
environment:
|
environment:
|
||||||
- AUR_CONFIG=conf/config
|
- AUR_CONFIG=conf/config
|
||||||
- DB_HOST=mariadb
|
|
||||||
- FASTAPI_WORKERS=${FASTAPI_WORKERS}
|
- FASTAPI_WORKERS=${FASTAPI_WORKERS}
|
||||||
entrypoint: /docker/fastapi-entrypoint.sh
|
entrypoint: /docker/fastapi-entrypoint.sh
|
||||||
command: /docker/scripts/run-fastapi.sh "${FASTAPI_BACKEND}"
|
command: /docker/scripts/run-fastapi.sh "${FASTAPI_BACKEND}"
|
||||||
|
@ -171,6 +172,8 @@ services:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
volumes:
|
||||||
|
- mariadb_run:/var/run/mysqld
|
||||||
ports:
|
ports:
|
||||||
- "18000:8000"
|
- "18000:8000"
|
||||||
|
|
||||||
|
@ -228,7 +231,6 @@ services:
|
||||||
init: true
|
init: true
|
||||||
environment:
|
environment:
|
||||||
- AUR_CONFIG=conf/config
|
- AUR_CONFIG=conf/config
|
||||||
- DB_HOST=mariadb
|
|
||||||
entrypoint: /docker/test-mysql-entrypoint.sh
|
entrypoint: /docker/test-mysql-entrypoint.sh
|
||||||
command: /docker/scripts/run-pytests.sh clean
|
command: /docker/scripts/run-pytests.sh clean
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
|
@ -237,6 +239,7 @@ services:
|
||||||
mariadb_init:
|
mariadb_init:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
volumes:
|
volumes:
|
||||||
|
- mariadb_run:/var/run/mysqld
|
||||||
- git_data:/aurweb/aur.git
|
- git_data:/aurweb/aur.git
|
||||||
- ./cache:/cache
|
- ./cache:/cache
|
||||||
- ./aurweb:/aurweb/aurweb
|
- ./aurweb:/aurweb/aurweb
|
||||||
|
@ -274,7 +277,6 @@ services:
|
||||||
init: true
|
init: true
|
||||||
environment:
|
environment:
|
||||||
- AUR_CONFIG=conf/config
|
- AUR_CONFIG=conf/config
|
||||||
- DB_HOST=mariadb
|
|
||||||
entrypoint: /docker/tests-entrypoint.sh
|
entrypoint: /docker/tests-entrypoint.sh
|
||||||
command: setup-sqlite.sh run-tests.sh
|
command: setup-sqlite.sh run-tests.sh
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
|
@ -283,6 +285,7 @@ services:
|
||||||
mariadb_init:
|
mariadb_init:
|
||||||
condition: service_started
|
condition: service_started
|
||||||
volumes:
|
volumes:
|
||||||
|
- mariadb_run:/var/run/mysqld
|
||||||
- git_data:/aurweb/aur.git
|
- git_data:/aurweb/aur.git
|
||||||
- ./cache:/cache
|
- ./cache:/cache
|
||||||
- ./aurweb:/aurweb/aurweb
|
- ./aurweb:/aurweb/aurweb
|
||||||
|
|
|
@ -1,19 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
|
|
||||||
[[ -z "$DB_HOST" ]] && echo 'Error: $DB_HOST required but missing.' && exit 1
|
|
||||||
|
|
||||||
DB_NAME="aurweb"
|
|
||||||
DB_USER="aur"
|
|
||||||
DB_PASS="aur"
|
|
||||||
|
|
||||||
# Setup a config for our mysql db.
|
# Setup a config for our mysql db.
|
||||||
cp -vf conf/config.dev conf/config
|
cp -vf conf/config.dev conf/config
|
||||||
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
|
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
|
||||||
sed -ri "s/^(name) = .+/\1 = ${DB_NAME}/" conf/config
|
|
||||||
sed -ri "s/^(host) = .+/\1 = ${DB_HOST}/" conf/config
|
|
||||||
sed -ri "s/^(user) = .+/\1 = ${DB_USER}/" conf/config
|
|
||||||
sed -ri "s/^;?(password) = .+/\1 = ${DB_PASS}/" conf/config
|
|
||||||
|
|
||||||
sed -ri "s;^(aur_location) = .+;\1 = https://localhost:8444;" conf/config
|
sed -ri "s;^(aur_location) = .+;\1 = https://localhost:8444;" conf/config
|
||||||
|
|
||||||
|
|
|
@ -38,18 +38,9 @@ Match User aur
|
||||||
AcceptEnv AUR_OVERWRITE
|
AcceptEnv AUR_OVERWRITE
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
DB_NAME="aurweb"
|
|
||||||
DB_HOST="mariadb"
|
|
||||||
DB_USER="aur"
|
|
||||||
DB_PASS="aur"
|
|
||||||
|
|
||||||
# Setup a config for our mysql db.
|
# Setup a config for our mysql db.
|
||||||
cp -vf conf/config.dev $AUR_CONFIG
|
cp -vf conf/config.dev $AUR_CONFIG
|
||||||
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" $AUR_CONFIG
|
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" $AUR_CONFIG
|
||||||
sed -ri "s/^(name) = .+/\1 = ${DB_NAME}/" $AUR_CONFIG
|
|
||||||
sed -ri "s/^(host) = .+/\1 = ${DB_HOST}/" $AUR_CONFIG
|
|
||||||
sed -ri "s/^(user) = .+/\1 = ${DB_USER}/" $AUR_CONFIG
|
|
||||||
sed -ri "s/^;?(password) = .+/\1 = ${DB_PASS}/" $AUR_CONFIG
|
|
||||||
|
|
||||||
AUR_CONFIG_DEFAULTS="${AUR_CONFIG}.defaults"
|
AUR_CONFIG_DEFAULTS="${AUR_CONFIG}.defaults"
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
|
|
||||||
[[ -z "$DB_HOST" ]] && echo 'Error: $DB_HOST required but missing.' && exit 1
|
|
||||||
|
|
||||||
DB_NAME="aurweb"
|
|
||||||
DB_USER="aur"
|
|
||||||
DB_PASS="aur"
|
|
||||||
|
|
||||||
# Setup a config for our mysql db.
|
# Setup a config for our mysql db.
|
||||||
cp -vf conf/config.dev conf/config
|
cp -vf conf/config.dev conf/config
|
||||||
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
|
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
|
||||||
sed -ri "s/^(name) = .+/\1 = ${DB_NAME}/" conf/config
|
|
||||||
sed -ri "s/^(host) = .+/\1 = ${DB_HOST}/" conf/config
|
|
||||||
sed -ri "s/^(user) = .+/\1 = ${DB_USER}/" conf/config
|
|
||||||
sed -ri "s/^;?(password) = .+/\1 = ${DB_PASS}/" conf/config
|
|
||||||
|
|
||||||
python -m aurweb.initdb 2>/dev/null || /bin/true
|
python -m aurweb.initdb 2>/dev/null || /bin/true
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
|
|
||||||
[[ -z "$DB_HOST" ]] && echo 'Error: $DB_HOST required but missing.' && exit 1
|
|
||||||
|
|
||||||
DB_NAME="aurweb"
|
|
||||||
DB_USER="aur"
|
|
||||||
DB_PASS="aur"
|
|
||||||
|
|
||||||
# Setup a config for our mysql db.
|
# Setup a config for our mysql db.
|
||||||
cp -vf conf/config.dev conf/config
|
cp -vf conf/config.dev conf/config
|
||||||
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
|
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
|
||||||
sed -ri "s/^(name) = .+/\1 = ${DB_NAME}/" conf/config
|
|
||||||
sed -ri "s/^(host) = .+/\1 = ${DB_HOST}/" conf/config
|
|
||||||
sed -ri "s/^(user) = .+/\1 = ${DB_USER}/" conf/config
|
|
||||||
sed -ri "s/^;?(password) = .+/\1 = ${DB_PASS}/" conf/config
|
|
||||||
|
|
||||||
sed -ri "s;^(aur_location) = .+;\1 = https://localhost:8443;" conf/config
|
sed -ri "s;^(aur_location) = .+;\1 = https://localhost:8443;" conf/config
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,12 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eou pipefail
|
set -eou pipefail
|
||||||
|
|
||||||
[[ -z "$DB_HOST" ]] && echo 'Error: $DB_HOST required but missing.' && exit 1
|
|
||||||
|
|
||||||
DB_NAME="aurweb_test"
|
DB_NAME="aurweb_test"
|
||||||
DB_USER="aur"
|
|
||||||
DB_PASS="aur"
|
|
||||||
|
|
||||||
# Setup a config for our mysql db.
|
# Setup a config for our mysql db.
|
||||||
cp -vf conf/config.dev conf/config
|
cp -vf conf/config.dev conf/config
|
||||||
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
|
sed -i "s;YOUR_AUR_ROOT;$(pwd);g" conf/config
|
||||||
sed -ri "s/^(name) = .+/\1 = ${DB_NAME}/" conf/config
|
sed -ri "s/^(name) = .+/\1 = ${DB_NAME}/" conf/config
|
||||||
sed -ri "s/^(host) = .+/\1 = ${DB_HOST}/" conf/config
|
|
||||||
sed -ri "s/^(user) = .+/\1 = ${DB_USER}/" conf/config
|
|
||||||
sed -ri "s/^;?(password) = .+/\1 = ${DB_PASS}/" conf/config
|
|
||||||
|
|
||||||
# The port can be excluded from use if properly using
|
# The port can be excluded from use if properly using
|
||||||
# volumes to share the mysql socket from the mariadb service.
|
# volumes to share the mysql socket from the mariadb service.
|
||||||
|
|
Loading…
Add table
Reference in a new issue