Use proper docker volumes in docker compose

This commit is contained in:
Timothy Hobbs 2025-01-21 20:24:35 +01:00
parent b8f4ba6d79
commit abe22b6dda
2 changed files with 34 additions and 28 deletions

View File

@ -67,11 +67,9 @@ Configuration for Production Use
1. Update the `Caddyfile` to replace the `localhost` URL with your desired production URL.
2. Modify the `docker-compose` file to adjust the paths. By default, files are stored in `/tmp`.
2. For custom configurations, bindmount a `local_settings.py` into `/opt/django-helpdesk/standalone/config/local_settings.py`.
3. For custom configurations, bindmount a `local_settings.py` into `/opt/django-helpdesk/standalone/config/local_settings.py`.
4. To customize the logo in the top-left corner of the helpdesk:
3. To customize the logo in the top-left corner of the helpdesk:
.. code-block:: html

View File

@ -1,28 +1,36 @@
version: '2'
# Define named volumes
volumes:
caddy_data:
caddy_config:
helpdesk_data:
postgres_data:
services:
caddy:
image: caddy:2
restart: unless-stopped
volumes:
- /tmp/data/caddy/data:/data
- /tmp/data/caddy/config:/config
- ./Caddyfile:/etc/caddy/Caddyfile:r
ports:
- "80:80"
- "443:443"
caddy:
image: caddy:2
restart: unless-stopped
volumes:
- caddy_data:/data
- caddy_config:/config
- ./Caddyfile:/etc/caddy/Caddyfile:ro
ports:
- "80:80"
- "443:443"
django-helpdesk:
image: djangohelpdesk/standalone
user: root
volumes:
- /tmp/django-helpdesk-data:/data/
- ./custom_navigation_header.html:/opt/django-helpdesk/helpdesk/templates/helpdesk/custom_navigation_header.html:r
env_file: docker.env
depends_on:
- postgres
django-helpdesk:
image: djangohelpdesk/standalone
user: root
volumes:
- helpdesk_data:/data
- ./custom_navigation_header.html:/opt/django-helpdesk/helpdesk/templates/helpdesk/custom_navigation_header.html:ro
env_file: docker.env
depends_on:
- postgres
postgres:
image: postgres:12-bullseye
volumes:
- ./db:/var/lib/postgresql/data
env_file: docker.env
postgres:
image: postgres:12-bullseye
volumes:
- postgres_data:/var/lib/postgresql/data
env_file: docker.env