3.6 KiB
3.6 KiB
Codex Context: Terraform VM + Docker Compose Test (Single Node)
Goal
Test a single-node Docker Compose deployment on a Terraform-provisioned VM (no k3s), using the same layout as swarm. Ensure backend + FE + proxies come up and healthcheck works. This is a throwaway, clean environment.
Current State
- VM created via Terraform:
terraform-testvm-1on Proxmox noderbmk2. - IP:
10.1.50.125/24, gateway10.1.50.1. - SSH:
ssh devops@10.1.50.125 -p42315(company policy non-22). - Docker installed via
get.docker.comon the VM. - Compose location on VM:
/webapps/wolkabout. - Volume/config location on VM:
/mnt/docker-volumes/wolkabout. - HAProxy fixed by ensuring
options.httpends with a blank line.
Files on laptop
- New compose file with MySQL + Cassandra:
/home/nikola/codex-cli/docker-compose.with-dbs.yml(version 2.4). - This file was copied to the VM as
/webapps/wolkabout/docker-compose.yml.
Compose contents (high level)
- Services:
mysql8,cassandra,cloud-config,rabbitmq,mosquitto,backend,frontend,frontend-federated,http2amqp,mqtt2amqp,loki,haproxy. - Ordered startup using
depends_on+ healthchecks (DBs first, then base infra, then app/FE). - Network name:
core-net(kept same name). - MySQL image:
mysql:8.0.32-debianwith:- root password
password - DB
swarm, userwolk, passwordTest1234 - volumes:
/mnt/docker-volumes/wolkabout/mysql8, init folder/mnt/docker-volumes/wolkabout/mysql8-init, config/mnt/docker-volumes/wolkabout/config/mysql-custom.cnf
- root password
- Cassandra image:
cassandra:4.1.2, volume/mnt/docker-volumes/wolkabout/cassandra, heap env.
Config changes still needed on VM
Update these to point to local DBs/containers:
/mnt/docker-volumes/wolkabout/config/wolk-commons.ymlspring.datasource.url->jdbc:mysql://mysql8:3306/swarm?...spring.datasource.username->wolkspring.datasource.password->Test1234spring.cassandra.contact-points->cassandra
/mnt/docker-volumes/wolkabout/config/mosquitto.confauth_opt_host mysql8auth_opt_dbname swarmauth_opt_user wolkauth_opt_pass Test1234
MySQL/Cassandra init
No dump yet. We want a clean environment. Create minimal init:
- MySQL init dir:
/mnt/docker-volumes/wolkabout/mysql8-init/init.sql- For now can just
CREATE DATABASE IF NOT EXISTS swarm;.
- For now can just
- Cassandra keyspace:
swarm(fromwolk-commons.yml).
Recommended scripts on VM (create in /webapps/wolkabout):
init-mysql.shwaits for mysql, applies init.sql if present.init-cassandra.shwaits for cassandra, creates keyspaceswarm.
Docker registry login
ECR images require login on the VM. On swarm1 there is ~/.aws/credentials and ~/.aws/config (region eu-west-1). Use those creds (copy from swarm1 or your internal source) and run:
aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 629307322585.dkr.ecr.eu-west-1.amazonaws.com
Known runtime issue
mosquittofails if MySQL schema/tables do not exist (MosquittoUser,MosquittoTopic). Backend may not auto-create them. If needed, we must add minimal SQL schema later.
Healthcheck target
Backend is considered ready when:
https://<domain>.wolkabout.com/api/infos/serverreturns JSON.
Next Actions (expected)
- Create
/mnt/docker-volumes/wolkabout/config/mysql-custom.cnf(utf8mb4 + mysql_native_password + max_connections + bind-address). - Update
wolk-commons.yml+mosquitto.confto local DB hostnames. - Create init scripts + minimal init.sql.
docker compose downthenup -d.- Run init scripts and validate with
docker compose ps.