Skip to content

Run everything with Docker Compose - #2

Merged
phuthuycoding merged 2 commits into
mainfrom
phuthuycoding/feat/docker-compose
Oct 7, 2026
Merged

phuthuycoding merged 2 commits into
mainfrom
phuthuycoding/feat/docker-compose

Conversation

@phuthuycoding

Copy link
Copy Markdown
Owner

What

  • compose.yaml: local MongoDB (mongo:7) and MySQL (mysql:8.4) from the official images with the root credentials dbclone expects, plus a dbclone service (compose profile cli, so up -d never starts it) built from the new Dockerfile.
  • Dockerfile: multi-stage, static binary on alpine + docker-cli. dbclone only needs the Docker CLI and the socket, because every dump/restore still runs inside the two containers.
  • Profiles persist in the dbclone-config volume; logs land in ./logs. Names, ports and the local root password are overridable (DBCLONE_MONGO_CONTAINER, DBCLONE_MYSQL_CONTAINER, DBCLONE_MONGO_PORT, DBCLONE_MYSQL_PORT, DBCLONE_LOCAL_PASSWORD).
  • README: "Or run everything with Docker Compose" section.

Verified

On this machine, with overridden names/ports (the default names and ports were already taken):

docker compose run --rm dbclone -check
  ✓ Docker  29.8.2
  ✓ mongo: local container "dbclone-test-mongodb"  running
  ✓ mysql: local container "dbclone-test-mysql"  running

docker compose run --rm dbclone -from staging -only mongo:demo,mysql:demo -yes
Done 2/2 databases in 1s

Target counts after the clone: demo.orders 5000 documents, demo.users 3000 rows, matching the seeded sources. Logs appeared in ./logs/<run> on the host.

phuthuycoding added 2 commits October 7, 2026 09:36
compose.yaml starts local MongoDB and MySQL from the official images with the root
credentials dbclone expects, and a 'dbclone' service (profile cli) built from the new
Dockerfile: static binary + docker-cli, talking to the containers over the Docker socket.
Profiles persist in a named volume, logs in ./logs. Names, ports and the local password
are overridable from the environment.
@phuthuycoding
phuthuycoding merged commit 8599713 into main Oct 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant