diff --git a/servers/kid/docker-compose.d/custom/nginx/conf.d/takahe.conf b/servers/kid/docker-compose.d/custom/nginx/conf.d/takahe.conf new file mode 100644 index 0000000..71d1f14 --- /dev/null +++ b/servers/kid/docker-compose.d/custom/nginx/conf.d/takahe.conf @@ -0,0 +1,13 @@ +server { + listen 80; + server_name takahe.ixvd.net; + + location / { + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port 443; + + proxy_pass http://takahe:8000; + } +} \ No newline at end of file diff --git a/servers/kid/docker-compose.d/docker-compose.takahe.yml b/servers/kid/docker-compose.d/docker-compose.takahe.yml new file mode 100644 index 0000000..4d7d7f6 --- /dev/null +++ b/servers/kid/docker-compose.d/docker-compose.takahe.yml @@ -0,0 +1,62 @@ +version: '2.2' + +x-takahe-common: &takahe-common + image: jointakahe/takahe:latest + restart: on-failure + environment: &takahe-common-environment + TAKAHE_DATABASE_SERVER: "postgres://takahe:takahe@takahe-db/takahe" + TAKAHE_MEDIA_BACKEND: "local://" + TAKAHE_MEDIA_ROOT: "/media" + TAKAHE_MEDIA_URL: "/media/" + TAKAHE_MAIN_DOMAIN: "takahe.ixvd.net" + env_file: + - /etc/ixvd/secrets/env/takahe.env + volumes: + - /srv/takahe/data:/media + networks: &takahe-common-networks + - takahe + +services: + takahe: + <<: *takahe-common + healthcheck: + test: ["CMD", "nc", "-z", "-v", "localhost", "8000"] + interval: 20s + timeout: 60s + start_period: 15s + depends_on: + setup: + condition: service_completed_successfully + networks: + - takahe + - proxy + + takahe-stator: + <<: *takahe-common + command: ["/takahe/manage.py", "runstator"] + depends_on: + setup: + condition: service_completed_successfully + + takahe-setup: + <<: *takahe-common + restart: "no" + command: > + bash -c "/takahe/manage.py migrate && /takahe/manage.py collectstatic --noinput" + + takahe-db: + image: docker.io/postgres:15-alpine + healthcheck: + test: ['CMD', 'pg_isready', '-U', 'postgres'] + volumes: + - /srv/takahe/other/db:/var/lib/postgresql/data + restart: always + environment: + POSTGRES_DB: takahe + POSTGRES_USER: takahe + POSTGRES_PASSWORD: takahe + networks: + - takahe + +networks: + takahe: \ No newline at end of file