btcpayserver-docker/Tools/fireflyiii/init.sh
Andrew Camilleri d09338b2e5
Feat/fireflyiii (#344)
* Adding Firefly-iii opt fragment

* Adding environment variable to force creation of db

* Instructing postgres to create database

* Switching exposing default port, running create db command

* Remove grep command for postgres container

* Removing database creation on postgres container start

* Adding required App Key env variable

* Updating nginx rewriting

* Updating firefly nginx confugration traying to make it work with subdirectory

https://github.com/firefly-iii/firefly-iii/issues/2848#issuecomment-557845301

* Trying to rewrite

* Reconfiguring nginx to pass headers

* Updating docker fragment

* Last try

* Allowing firefly iii to be hosted on other domain

* Fixing docker compose env variables

* Exposing ports for external communication

* Ports exposing

* Updating firefly host reference

* Matching service name and VIRTUAL_HOST_NAME

* Getting nginx to redirect to port 8080

* update and adapt

* Adapt firefly to be with dedicated domain

* Adapt Docker file builder to support non github builds

* Make firefly init create db only if not exists + run full recommended upgrade procedure

Co-authored-by: rockstardev <rockstardev@users.noreply.github.com>
2021-09-23 18:04:11 +09:00

11 lines
664 B
Bash
Executable File

#!/bin/bash
[[ $(docker exec $(docker ps -a -q -f "name=postgres_1") psql -U postgres -tc "SELECT 1 FROM pg_database WHERE datname = 'fireflyiii'") =~ "1" ]] || docker exec $(docker ps -a -q -f "name=postgres_1") psql -U postgres -c "CREATE DATABASE fireflyiii"
docker exec generated_fireflyiii_1 php artisan migrate --seed
docker exec generated_fireflyiii_1 php artisan firefly-iii:decrypt-all
docker exec generated_fireflyiii_1 php artisan cache:clear
docker exec generated_fireflyiii_1 php artisan firefly-iii:upgrade-database
docker exec generated_fireflyiii_1 php artisan passport:install
docker exec generated_fireflyiii_1 php artisan cache:clear
exit 0