# dbCove and its repository on one Docker host: the PostgreSQL that comes with dbCove, in the postgres service below. # For a repository on your own PostgreSQL or Oracle no file is needed: one docker run command starts dbCove alone # (https://dbcove.com/docs/install-docker). # # Start it with one command: # docker compose -f oci://dbcove/compose up -d --wait -y # The command ends when dbCove is ready; then open https:/// and sign in as admin. The first password of # admin is in `docker compose -p dbcove logs dbcove`, once, between two lines of '='. If the command ends with an # error, the same log says why. Starting dbCove accepts its license agreement (/opt/dbcove/EULA.txt in the image). # A release by number: oci://dbcove/compose:. Docker Compose older than 2.34 cannot read oci://: save this # file (https://dbcove.com/docker.yaml) and use it as below. # A variable before the command sets the first password, the port or the time zone: # bash: DBCOVE_PORT=8443 docker compose -f oci://dbcove/compose up -d --wait -y # Windows PowerShell: $env:DBCOVE_PORT='8443'; docker compose -f oci://dbcove/compose up -d --wait -y # Or save this file as compose.yaml in an empty folder, edit it (a value after ":-" is what applies when the variable # is not set), and run docker compose up -d there. # # The variables (the default when one is not set or is empty): # DBCOVE_PASSWORD The first password of admin, at least 8 characters. It applies only when the repository is new. # Default: dbCove makes one and shows it once in `docker compose -p dbcove logs dbcove`, between two # lines of '='. # DBCOVE_TZ The time zone of both services (reports, maintenance windows, the day's boundaries), for example # Europe/Berlin. Set the same on the repository's server. Default Etc/UTC. # DBCOVE_PORT The host port of HTTPS. Default 443. # # Upgrade: run the same command again; the file it reads names the new release. With a saved file, change the image's # tag and run docker compose up -d. The API brings the repository up to the new release when it starts; the health # check waits for it. # # Later, without the file: docker compose -p dbcove logs dbcove | stop | start | down. down keeps the volumes; # down -v deletes them, and with them the repository. # # The PostgreSQL superuser's password is made on the first start and kept in the dbcove-postgres-data volume, # beside the database it belongs to: back up the two volumes, dbcove-data and dbcove-postgres-data. # # Certificate and reverse proxy (in a saved file): # - Your own certificate: mount the .pfx and set Server__Certificate__Path (and Server__Certificate__Password) on the # dbcove service. Without one, dbCove makes a self-signed certificate for the host name below; more names on it with # Server__Certificate__ExtraNames (for example "dbcove.example.com;10.0.0.5"). # - Behind a reverse proxy that does TLS: set Server__HttpBind=Any, publish or proxy port 5137 (plain HTTP) instead of # 443, and let the proxy pass WebSocket connections (Upgrade, Connection) with idle time above 60 seconds. # What Docker makes for dbCove carries its name: the containers dbcove-app and dbcove-postgres, the volumes dbcove-data # and dbcove-postgres-data, the network dbcove. Fixed names allow one copy on a Docker host: one dbCove, one repository. name: dbcove services: dbcove: image: dbcove/dbcove:3.2.11 container_name: dbcove-app # Rows the repository keeps per server and the self-signed certificate are named after it: keep it fixed. hostname: dbcove restart: unless-stopped depends_on: postgres: condition: service_healthy ports: # In long syntax: docker compose publish refuses a port that a variable sets in the short one. - target: 5138 published: "${DBCOVE_PORT:-443}" environment: # Scheduled work (reports, maintenance windows, the day's boundaries) runs on this clock. TZ: "${DBCOVE_TZ:-Etc/UTC}" DBCOVE_ADMIN_PASSWORD: "${DBCOVE_PASSWORD:-}" DBCOVE_REPOSITORY_HOST: postgres DBCOVE_REPOSITORY_SUPERUSER_PASSWORD_FILE: /run/postgres-data/superuser_password volumes: # Read-only, for the superuser's password only (the database's own folder is closed to this container). Without # dbcove-data, dbCove sets its own role's password again with it. - dbcove-postgres-data:/run/postgres-data:ro # Keys, the sealed repository connection, certificates and logs. Losing it means entering the recovery code. - dbcove-data:/var/lib/dbcove # The API stops its collectors and writes its last log rows before it ends. stop_grace_period: 60s # Without a limit .NET sees the whole host and keeps what it takes. 2 GB is for a small installation: raise it with databases. mem_limit: 2g # Docker keeps at most three console log files of 10 MB for this service; its own default keeps them all. logging: driver: json-file options: max-size: "10m" max-file: "3" postgres: image: postgres:18 container_name: dbcove-postgres restart: unless-stopped environment: # The same time zone as the dbcove service. TZ: "${DBCOVE_TZ:-Etc/UTC}" POSTGRES_PASSWORD_FILE: /var/lib/postgresql/superuser_password # As the PostgreSQL dbCove Setup installs on Windows: UTF8, every locale category C, text by the builtin C.UTF-8. POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C --locale-provider=builtin --builtin-locale=C.UTF-8" # Makes the superuser's password when the volume holds none (40 letters and digits, written whole, readable only by # the dbcove image's user, 1654), then starts as the image does. The database itself is in the 18/docker folder. entrypoint: - bash - -c - | f=/var/lib/postgresql/superuser_password if [ ! -s "$$f" ]; then t=$$(mktemp "$$f.XXXXXX") && LC_ALL=C tr -dc A-Za-z0-9 "$$t" && chown 1654 "$$t" && chmod 400 "$$t" && mv -f "$$t" "$$f" || exit 1 fi exec docker-entrypoint.sh "$$@" - postgres # dbCove's pool may hold one connection per monitored database plus 100. command: ["postgres", "-c", "max_connections=1000"] # PostgreSQL's parallel queries use shared memory; Docker gives a container 64 MB of it. shm_size: 256mb volumes: # The database and, beside it, its superuser's password. - dbcove-postgres-data:/var/lib/postgresql healthcheck: test: ["CMD", "pg_isready", "-U", "postgres"] interval: 5s timeout: 5s retries: 30 stop_grace_period: 60s # Docker keeps at most three console log files of 10 MB for this service; its own default keeps them all. logging: driver: json-file options: max-size: "10m" max-file: "3" volumes: dbcove-data: name: dbcove-data dbcove-postgres-data: name: dbcove-postgres-data networks: default: name: dbcove