Please feedback env config prior to first ever docker run command

HOST / IMAGE DETAILS
Machine : remote VPS
Server : Apache2.4
OS distro : Ubuntu 22.04 LTS
DB server and database : MariaDB

Docker image : algoo/tracim

Hello,

Prior to run a container for the first time, and in the purpose to better understand how docker works, I wish someone to reply simple questions at the end of this post, but I first wish to know if :

My environment configuration of choice is viable
My command line to run tracim app’s container do match my environment configuration of choice

DOCKER CL
docker run --name tracim --env-file .env -p 8080:80 - p 3306:3306 -v ~/var/www/clients/client1/web1/web/tracim/etc:/etc/tracim -v ~/var/www/clients/client1/web1/web/tracim/var:/var/tracim -d algoo/tracim

ENVIRONMENT CONFIGURATION

  • It assumes pre-existing domain, blank website, and a non-containerized database, set on host (VPS), from using ISPConfig panel (kind of cpanel).

  • It assumes that accordingly to ISPConfig panel default file structure, I created required volumes “tracim/etc“, “tracim/var“, within the pre-existing blank website’s root directory that is located at /var/www/clients/client1/web1/web/

  • It assumes that I changed MariaDB server’s bind-address to 172.17.0.1, so to allow remote connexion from tracim app’s container.

  • It assumes that the dbuser has been allowed to remotly access the database from any host (done from a check-box in ISPConfig panel).

  • It assumes that, so to pass the database environment variables to container, I created and edited a .ENV file within “tracim“ volume located at var/www/clients/client1/web1/web/

QUESTIONS

  • Q1 : do I have to make a change so my website’s root directory to be tracim app’s container, or is this unnecessary ?

  • Q2 : do I have to add the “APP_URL=value“ to the .ENV file, and could it be that accessing tracim login page fails if missing ?

  • Q3 : do I have to add a host entry to the container by completing the command line with e.g. : –add-host yourdomain.com:127.0.0.1 ?

  • Q4 : Is the use of a Cpanel a barrier when setting up a docker container ?

  • Q5 : Should I consider the “tracim“ volume as my docker project’s directory, and if not, where is such a docker project directory located ?

Regards

Hi @keepshango,

I am not sure, if I understand all your questions. This is your first test of a docker container? I learned about docker a couple of weeks ago. It is not that complicated to learn. Good thing is, you can try to test a container - and if things go sideways, just stop and remove it and start over again. Nothing to loose.

In your case, do it step-by-step.

  1. Follow the steps on the dockerhup-page: on your local machine, you have to create 2 folders (-> /tracim/etc and /tracim/var). These folders are there to persist the data of the container. If you stop, remove and start over, this folders will make sure, that nothing is lost.

I do save all my container data in one directory, with easy access: e.g. /home/[usermane]/docker/[container name]/data/[folders to persist]. This way, backup gets a lot easier. Or if you start working with VSCODE and would like to ssh into that folders, it is good to have them all in one location.

  1. Start your container with the command and see what happens.

  2. Have a look into the container logs. If it does not work as expected, the logs are a good starting point.

  3. docker run vs. docker compose
    I very much prefer docker compose, because you usually find an example compose.yaml and because the Documentation is very easy to read. I found it easier to create a basic yaml, test it and then add - step-by-step - all the needed network-configuration or environment variables.

To your questions:

Well, the container will probably have a webserver included. After having started the container, go to http://localhost:8080 and see, what is there. You probably can include that page as an iframe into your own page?

As I said above, you are free to choose your directory. I took /home/[usermane]/docker/ as my root directory for all my containers. I have read of other locations, such as /opt/docker/.

  1. Think about using portainer :slight_smile: : https://hub.docker.com/r/portainer/portainer-ce