Skip to content

Use hyphens in container, image and network names - #183

Open
tire-fire wants to merge 1 commit into
dbaseqp:mainfrom
tire-fire:chore/hyphen-names
Open

tire-fire wants to merge 1 commit into
dbaseqp:mainfrom
tire-fire:chore/hyphen-names

Conversation

@tire-fire

Copy link
Copy Markdown
Contributor

Container, image and network names mixed two styles. Names written by hand used underscores (quotient_server, quotient_redis, quotient_database, quotient_network). Names Compose generates use hyphens (quotient-runner, quotient-divisor, and containers like quotient-runner-1). That made it easy to type the wrong one in docker logs, docker exec and similar commands.

This switches the hand-written names to hyphens:

  • docker-compose.yml:
    • containers quotient-server, quotient-redis and quotient-database;
    • image quotient-server;
    • network quotient-network, also in docker-compose.base.yml.
  • The default Redis address in engine/engine.go and runner/runner.go is now quotient-redis:6379. Container names double as hostnames on the Compose network, so this default has to match the container.
  • .env, README.md and config/event.conf.example use the new database and Redis hostnames.

Volumes (db_data, redis_data) are unchanged so existing installs keep their data.

Upgrading an existing deployment

  • docker compose up -d recreates the renamed containers. The data volumes are unchanged, so nothing is lost.
  • Anyone who sets POSTGRES_HOST, DBConnectURL or REDIS_ADDR to the old names in their own .env or event.conf needs to update them.
  • Scripts that call docker logs quotient_server or similar need the new names.
  • The old Compose network can be removed with docker network rm <project>_quotient_network.

divisor/README.md still mentions quotient_redis. The divisor is a separate repository, so that needs its own change.

Unit tests pass and docker compose config validates.

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