Please add external MySQL support
Hey !
Is it please possible to add support for var to point to external MySQL??
similar to this:
DB_DATABASE="linguacafe" DB_USERNAME="linguacafe" DB_PASSWORD="linguacafe"
eg DB_HOST=
Sure, it can be added. Actually, you can add it yourself in the meantime I think.
You can modify the docker-compose.yml if you are using v0.12:
webserver:
image: ghcr.io/simjanos-dev/linguacafe-webserver:${VERSION:-latest}
container_name: linguacafe-webserver
restart: unless-stopped
depends_on:
- mysql
volumes:
- ./storage:/var/www/html/storage
environment:
DB_DATABASE: ${DB_DATABASE:-linguacafe}
DB_USERNAME: ${DB_USERNAME:-linguacafe}
DB_PASSWORD: ${DB_PASSWORD:-linguacafe}
DB_HOST: ${DB_HOST:-linguacafe-database}
DB_PORT: ${DB_PORT:-3306}
Then add these variables to a .env file.
At startup it will create the necessary tables, but you will have to create the database itself before that.
OK that worked, i just had to get rid of "" in the .env
Thank you!
I added support for this in the docker-compose.yml files in the repo.
@sergiolaverde0: Could you please double check if it's good? I'm a bit paranoid with docker. I tested it, it works for me. I assumed only the port number must be without "" marks.
Here's the commit.
I tested it without the quotes since I remembered them not being needed; after all, our default values are without quotes.
I tested it with Spanish as per not to spend time waiting for Japanese to be installed and it all seemed to work minus for a weird error message when trying to finish a chapter. After testing using quotes and using the default values I found the behaviour was the same. So quotes are optional and it all "works" except for a bug that seems to be entirely unrelated.
Later this week I will test more and open an issue once I get more info, but your changes are good to go.
Thank you!
minus for a weird error message when trying to finish a chapter
Couldn't reproduce today with none of Japanese, Spanish nor English so let's call it a red herring and hope it doesn't happen again.
@xXAzazelXx
Hi!
Do you use linguacafe yourself, or do you host it for someone else?
I made a mistake in a function, that affects your use-case. Any user that is logged in to linguacafe can request any laravel config values, which includes MySQL host/database/username/password. I'll release a hotfix.
Just myself, local only
Then it could have caused no problems, and the hotfix is released now.