put setup file in init.d
This commit is contained in:
parent
6e06308354
commit
bb37aa3be5
2 changed files with 2 additions and 14 deletions
|
@ -19,6 +19,7 @@ services:
|
||||||
user: ${DOCKER_USER}
|
user: ${DOCKER_USER}
|
||||||
volumes:
|
volumes:
|
||||||
- ./pgdata:/var/lib/postgresql/data:z
|
- ./pgdata:/var/lib/postgresql/data:z
|
||||||
|
- ./config/setup_db.psql:/docker-entrypoint-initdb.d/setup_db.sql
|
||||||
|
|
||||||
akkoma:
|
akkoma:
|
||||||
image: akkoma/akkoma:next
|
image: akkoma/akkoma:next
|
||||||
|
|
|
@ -5,22 +5,9 @@ set -euo pipefail
|
||||||
mkdir -p pgdata
|
mkdir -p pgdata
|
||||||
|
|
||||||
# This is sorta special in that we need the generated_config.exs to make it onto the host
|
# This is sorta special in that we need the generated_config.exs to make it onto the host
|
||||||
# We can also automate the DB setup here!
|
|
||||||
docker compose run \
|
docker compose run \
|
||||||
--rm \
|
--rm \
|
||||||
-e "PLEROMA_CTL_RPC_DISABLED=true" \
|
-e "PLEROMA_CTL_RPC_DISABLED=true" \
|
||||||
akkoma ./bin/pleroma_ctl instance gen --no-sql-user --no-db-creation --dbhost db --dbname akkoma --dbuser akkoma --dbpass akkoma --listen-ip 0.0.0.0 --listen-port 4000 --static-dir /opt/akkoma/instance/ --uploads-dir /opt/akkoma/uploads/ --db-configurable true --output /opt/akkoma/config/generated_config.exs --output-psql /opt/akkoma/config/setup_db.psql
|
akkoma ./bin/pleroma_ctl instance gen --no-sql-user --no-db-creation --dbhost db --dbname akkoma --dbuser akkoma --dbpass akkoma --listen-ip 0.0.0.0 --listen-port 4000 --static-dir /opt/akkoma/instance/ --uploads-dir /opt/akkoma/uploads/ --db-configurable true --output /opt/akkoma/config/generated_config.exs --output-psql /opt/akkoma/config/setup_db.psql
|
||||||
|
|
||||||
echo ""
|
echo "Instance generated!"
|
||||||
echo "=========================="
|
|
||||||
echo ""
|
|
||||||
echo "Setting up your database!"
|
|
||||||
|
|
||||||
docker compose start db
|
|
||||||
|
|
||||||
docker compose run \
|
|
||||||
--rm \
|
|
||||||
-e "PGPASSWORD=akkoma" \
|
|
||||||
-v "$(pwd)/config:/docker-entrypoint-initdb.d" \
|
|
||||||
db
|
|
||||||
|
|
Loading…
Reference in a new issue