Alex,
Docker is the best.
We use bind mounts for the "assets" directory. Up to you what you do with opensearch and postgres - you could use docker volumes for both, and use `pd_dump` to make database backups to save outside of the docker volume.
I am not aware of a best practice around where to store docker container configs and data. Given that the bind-mounted "assets" dir and files needs to be writable by the dotCMS docker user, see
https://github.com/dotCMS/core/blob/master/docker/dotcms/Dockerfile#L59-L63 It can be nice to
- create a "dotcms" linux user/group on the docker host with UID/GID 65001
- allow that user to run docker containers, usually by adding it to the "docker" group though that is distro-dependent
then maybe put your docker-compose files in directories like ~dotcms/containers/prod-2301/
Create a pg_dump file from your current site using options
pg_dump --no-owner --clean One nice way to import the pg_dump data from your old version when using a docker compose file like
https://github.com/dotCMS/core/tree/master/docker/docker-compose-examples/single-nodeis to
- edit docker-compose.yml to expose the postgres server port 5432
-
docker compose up -d db to start ONLY the postgres server - this prevents dotCMS from initializing a clean database
- load your pg_dump database data
- run "clean-tables.sql" - see attached
- run
docker compose up -d to start opensearch and dotcms containers
Logging into the backend from a remote (not localhost) location requires HTTPS for secure cookies. Port 8443 in the container uses HTTPS with a valid cert for
https://local.dotcms.site/We do not provide an example for nginx or any reverse proxy as there are many factors, primarily how to manage your SSL certs, that are beyond the purview of the application server. Once you find an nginx docker config that works for you, it can be added to your dotCMS docker-compose.yml file if you wish to run everything on one server.
Good luck!
Todd