Running Firefly III in a docker container under a subdirectory using Apache #4892
Replies: 5 comments 5 replies
-
Cool, thanks for sharing! |
Beta Was this translation helpful? Give feedback.
-
This is what I was looking for the past 30 days. It's just beautiful and useful. Thank you for sharing this precious information! Maintainer might add these in FAQ section or pin it somewhere to inform new users. |
Beta Was this translation helpful? Give feedback.
-
It is now in the FAQ! |
Beta Was this translation helpful? Give feedback.
-
I couldn't find the nginx equivalent anywhere, so here it is, I hope it helps someone:
|
Beta Was this translation helpful? Give feedback.
-
@cartbar thanks this solution. In my environment the "Dashboard" still points to http://dockerhostname:dockerport. Anyway, seems that this does not work for all URLs (I guess the ones on client side). If I try to change the daterage (in top right of the page) nothing happens because browser console display error How this can be fixed? |
Beta Was this translation helpful? Give feedback.
-
I have seen a number of comments about how to get Firefly III running in a Docker container, but not under the root directory. This is my solution.
First I installed a standalone MariaDB database (i.e. not in a Docker container - not strictly revelvant)
The Firefly docker container was created using
sudo docker container create -v firefly_iii_upload:/var/www/html/storage/upload -p8087:8080 -e APP_KEY=... -e DB_HOST=172.17.0.1 -e DB_PORT=3306 -e DB_CONNECTION=mysql -e DB_DATABASE=firefly_iii -e DB_USERNAME=... -e DB_PASSWORD=... -e TRUSTED_PROXIES="**" --network bridge --restart unless-stopped --name FireflyIII fireflyiii/core:latest
I installed a standalone Apache server, to act as an SSL terminator (i.e. it handles the SSL so that the Firefly server doesn't have to.
In the Apache server config I put:
ProxyAddHeaders is off to prevent Apache sending the X-Forward headers to Firefly, otherwise the URLs it populates in the response will include the correct website, but not the correct path.
Unsetting the Accept-Encoding header ensures that the response from Firefly is not compressed, otherwise the "Substitute" directive won't work
ProxyPass and ProxyPassReverse act as you would expect, so that Firefly will appear under the "accounts" directory.
The AddOutputFilterByType and Substitute directives alter the pages returned from Firefly, replacing the localhost urls with the website's url (obviously replace "..." with your website address
So far, it works as expected, so I hope this helps someone else
Beta Was this translation helpful? Give feedback.
All reactions