Improving standalone standalone-ness

This commit is contained in:
Timothy Hobbs 2024-07-21 21:12:54 +02:00
parent ff3df683ad
commit 325eaa6318
7 changed files with 38 additions and 9 deletions

1
standalone/.dockerignore Executable file
View File

@ -0,0 +1 @@
db/

View File

@ -1,3 +1,3 @@
localhost { localhost {
reverse_proxy django-helpdesk:8000 reverse_proxy django-helpdesk:8080
} }

View File

@ -7,9 +7,9 @@ RUN apt-get install -yqq \
cron \ cron \
git git
COPY requirements.txt /opt/django-helpdesk/requirements.txt COPY requirements.txt /opt/django-helpdesk/requirements.txt
COPY standalone/extra-requirements.txt /opt/django-helpdesk/standalone/extra-requirements.txt COPY standalone/requirements.txt /opt/django-helpdesk/standalone/requirements.txt
RUN pip3 install -r /opt/django-helpdesk/requirements.txt RUN pip3 install -r /opt/django-helpdesk/requirements.txt
RUN pip3 install -r /opt/django-helpdesk/standalone/extra-requirements.txt RUN pip3 install -r /opt/django-helpdesk/standalone/requirements.txt
COPY . /opt/django-helpdesk COPY . /opt/django-helpdesk
WORKDIR /opt/django-helpdesk WORKDIR /opt/django-helpdesk
RUN pip3 install -e . RUN pip3 install -e .

View File

@ -0,0 +1,30 @@
version: '2'
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"
django-helpdesk:
build:
context: ..
dockerfile: standalone/Dockerfile
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
postgres:
image: postgres:12-bullseye
volumes:
- ./db:/var/lib/postgresql/data
env_file: docker.env

View File

@ -12,9 +12,7 @@ services:
- "443:443" - "443:443"
django-helpdesk: django-helpdesk:
build: image: djangohelpdesk/standalone
context: ..
dockerfile: standalone/Dockerfile
user: root user: root
volumes: volumes:
- /tmp/django-helpdesk-data:/data/ - /tmp/django-helpdesk-data:/data/

View File

@ -1,3 +0,0 @@
whitenoise
gunicorn
psycopg2-binary

View File

@ -0,0 +1,3 @@
whitenoise
gunicorn
psycopg2-binary