A single dotCMS instance that bootstraps its database from an existing PostgreSQL dump on first startup, instead of from a starter site.
| Service | Image | Notes |
|---|---|---|
db |
pgvector/pgvector:pg18 |
PostgreSQL with pgvector |
opensearch |
opensearchproject/opensearch:1 |
Single-node search, ports 9200 / 9600 |
dotcms |
dotcms/dotcms:latest |
App server, ports 8082 (HTTP), 8443 (HTTPS), 4000 (Glowroot UI) |
dotCMS loads the SQL dump via the DB_LOAD_DUMP_SQL environment variable, which points at /data/dump/dump.sql inside the container. That path is mounted from a local .sql file you provide.
-
Required — point the dump mount at your local SQL file. Edit the
dotcmsservicevolumesentry and replace the placeholder with the path to your dump:- {local_path_DB.sql}.sql:/data/dump/dump.sqlFor example:
- ./my-backup.sql:/data/dump/dump.sqlThe dump is only loaded into a fresh/empty database. If the
dbdatavolume already contains data, the load is skipped — rundocker-compose down -vfirst to start clean. -
A custom starter can be set by uncommenting and updating this line (note: normally not needed when loading from a dump):
#CUSTOM_STARTER_URL: 'https://repo.dotcms.com/artifactory/libs-release-local/com/dotcms/starter/20260629/starter-20260629.zip' -
HTTPS is optional. To enable it, uncomment the SSL cert env vars and the
certsvolume mount (a cert can be created with the mkcert tool):#CMS_SSL_CERTIFICATE_FILE: '/certs/localhost.pem' #CMS_SSL_CERTIFICATE_KEY_FILE: '/certs/localhost-key.pem' #- ${HOME}/.dotcms/certs:/certs
docker-compose upOnce started, dotCMS is available at:
- http://localhost:8082 — log in with the admin credentials from the loaded dump (the user/password come from the database you imported, not the
DOT_INITIAL_ADMIN_PASSWORDvalue) - https://localhost:8443 (if SSL is enabled)
- http://localhost:4000 — Glowroot profiling UI (enabled by default; do not enable in production)
docker-compose down # stop and remove containers (keeps the database volume)
docker-compose down -v # also remove volumes (db, search, shared) — required to re-load the dumpImportant note: ctrl+c does not destroy instances.