I am a newbie to all of this. I have farmOS running on a vm (OCI) and when I try to set it up I am having DB connection issues. I decided that maybe I should build the mysql db in the docker container. But in order to do that it asks for a password? Anyone know what that password is?
Or if anyone has tips on connecting farmOS to the db that built on the vm outside of the docker container that would help too. I did some bind-address edits in my.cnf but that did not seem to help.
Can you describe some of the steps that you took to get to this point first? There are many ways to set up farmOS and its database in Docker.
If you are using the official MySQL Docker image it offers options for setting up the initial database user and password. See their docs here for more info: Docker
This is all user error on my part but i am stumped on how to give the farmos container access to the db i made. I tried some bind-address stuff to get the docker ip in there but did not really understand what i was doing and it did not work.
If there is anyone around who has a make a db and set it up so that the farmos docker can access it for dummies guide it would be helpful
I might just follow the dev guide. This is for personal use so not much customization will happen. Although eventually I will try to add some x y z tiles to the map… ha
Have you tried expanding the “Advanced options” and putting in a host/ip for the database? I think it defaults to “localhost” which I don’t think would work in this scenario because localhost from within the docker container wouldn’t point to where your DB is hosted.
Yea this is mainly a networking question. Think about the Docker container as one machine, and the host (where the database is installed) as a separate machine. They need to be able to talk to one another for the farmOS machine (the Docker container) to connect to the MySQL machine (the host container).
The way you have it set up is a little tricky, because from the perspective of the farmOS container, the host machine’s IP may change whenever you recreate the farmOS container. That is what host.docker.internal is meant to address… although as far as I know that only works with Docker for Mac/Windows, but you are on Ubuntu so it probably won’t work.
I might just follow the dev guide.
That will definitely be easier to set up, because it makes all the decisions about database container and networking for you. Since both the farmOS container and the database container (PostgreSQL in the case of the dev environment) are managed together via Docker Compose, they are accessible to one another within their own little network, with hostnames of www and db, respectively, so they can talk to one another.
I would not recommend using the dev environment for real data, however. The upgrade process is bumpier, so going from one version of farmOS to another will require more manual work to do.
You could also consider running MySQL/PostgreSQL in Docker in the same way that the dev environment is set up. You just need to start with the docker-compose.production.yml (renamed to docker-compose.yml) and add in a container for the database to that file.
You could start by coping in the db config from the dev environment config:
Thank you all for the pertinent information. I decided to go with the dev setup instructions and everything is working.
I might try this method later so that I have my own db external to docker that I can sync to somewhere else easier maybe?
Next projects regarding my setup will be to get a custom xyz tile service to work as a basemap and setting up the uploaded file directory following the instructions. My plan is to do all of these processes enough times that I have the process down and simple and will share my documentation.