mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-08 19:27:18 +02:00
- Dockerfile: build & install gunicorn wheels - compose: run initdb before start; use `python -m gunicorn` - env: add POSTGRES_* and BookWyrm Redis aliases (BROKER/ACTIVITY/CACHE) + CACHE_URL - vars: add cache URL, DB indices, and URL aliases for Redis Ref: https://chatgpt.com/share/68b7492b-3200-800f-80c4-295bc3233d68
45 lines
1.6 KiB
Django/Jinja
45 lines
1.6 KiB
Django/Jinja
{% include 'roles/docker-compose/templates/base.yml.j2' %}
|
|
|
|
application:
|
|
{% include 'roles/docker-container/templates/base.yml.j2' %}
|
|
command: >-
|
|
bash -lc '
|
|
python manage.py migrate --noinput &&
|
|
python manage.py collectstatic --noinput &&
|
|
(python manage.py initdb || true) &&
|
|
python -m gunicorn bookwyrm.wsgi:application --bind 0.0.0.0:{{ container_port }}
|
|
'
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: "{{ BOOKWYRM_CUSTOM_IMAGE }}"
|
|
container_name: "{{ BOOKWYRM_CONTAINER }}"
|
|
hostname: "{{ BOOKWYRM_HOSTNAME }}"
|
|
ports:
|
|
- "127.0.0.1:{{ ports.localhost.http[application_id] }}:{{ container_port }}"
|
|
volumes:
|
|
- 'data:/app/data'
|
|
- 'media:/app/media'
|
|
{% include 'roles/docker-container/templates/healthcheck/curl.yml.j2' %}
|
|
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
|
|
{% include 'roles/docker-container/templates/networks.yml.j2' %}
|
|
|
|
worker:
|
|
{% include 'roles/docker-container/templates/base.yml.j2' %}
|
|
image: "{{ BOOKWYRM_CUSTOM_IMAGE }}"
|
|
container_name: "{{ BOOKWYRM_WORKER_CONTAINER }}"
|
|
command: "bash -lc 'celery -A celerywyrm worker -l INFO'"
|
|
volumes:
|
|
- 'data:/app/data'
|
|
- 'media:/app/media'
|
|
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
|
|
{% include 'roles/docker-container/templates/networks.yml.j2' %}
|
|
|
|
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
|
|
data:
|
|
name: {{ BOOKWYRM_DATA_VOLUME }}
|
|
media:
|
|
name: {{ BOOKWYRM_MEDIA_VOLUME }}
|
|
|
|
{% include 'roles/docker-compose/templates/networks.yml.j2' %}
|