Installing Cloudlog with Docker¶
The repository includes a Docker setup. It starts Cloudlog and MariaDB on the computer in front of you, and opens the logbook in a browser. Development is done on the dev branch, and this is the setup used for that work.
You need Docker, with Compose. On Windows and Mac that is Docker Desktop. On Linux it is the Docker engine and the Compose plugin.
If you would prefer someone else to run the server, magicbug offer hosted Cloudlog.
1. Get the dev branch¶
git clone -b dev https://github.com/magicbug/Cloudlog.git
cd Cloudlog
If the folder is already on this computer, switch into it and check out dev:
git checkout dev
2. Create the environment file¶
Docker reads a file named .env. Copy the sample:
cp .env.sample .env
On Windows PowerShell:
Copy-Item .env.sample .env
Open .env before the first start. The database is created from these values, and Cloudlog's config is written from them. Changing them later does not rewrite a database that already exists.
MYSQL_ROOT_PASSWORD,MYSQL_USER, andMYSQL_PASSWORDare the database passwords. The sample values are fine on a computer only you use. Change them when anyone else can open port 80.MYSQL_DATABASEcan staycloudlog.MYSQL_HOSTstaysdb. That is the name of the database container, and Cloudlog reaches it by that name.BASE_LOCATORis your home grid, for exampleIO87IP. The sample is only a placeholder.WEBSITE_URLstayshttp://localhostwhen you open the site on this computer.DIRECTORYstays/var/www/html. That is the folder inside the container.
3. Start it¶
From the same folder:
docker compose up
The first start builds the images. PHP 8.5 and MariaDB are downloaded, so it takes a few minutes. Later starts are quicker. Add -d if you want the containers to keep running after you close the terminal:
docker compose up -d
Cloudlog listens on port 80. Open http://localhost.
If something else is already using port 80, change the published port in docker-compose.yml from "80:80" to "8080:80", set WEBSITE_URL to http://localhost:8080, and open that address.
4. Log in¶
The database is loaded from Cloudlog's install script, so the install wizard does not appear. Log in with the demo account, m0abc / demo, then do the same four jobs as any other install:
- Create your own login and delete the demo user.
- Update the country files, from the Admin menu.
- Create a station location and set it active.
- Create a station logbook, link that location, and set the logbook active.
The first start writes application/config/config.php and application/config/database.php in this folder. They contain the database password. Leave them out of anything you publish.
Stopping and updating¶
docker compose stop stops the containers. The contacts stay in the Docker volume named db_data. docker compose down also keeps that volume. docker compose down -v deletes it, and the log goes with it.
To pick up new code, stay on dev, pull, and start again:
git pull
docker compose up -d
When Dockerfile or Dockerfile-db has changed, rebuild:
docker compose up -d --build