Files
computer-playbook/roles/web-app-bluesky/templates/compose.yml.j2

67 lines
3.0 KiB
Django/Jinja

{% include 'roles/sys-svc-compose/templates/base.yml.j2' %}
{% set service_name = 'pds' %}
{{ service_name }}:
{{ lookup('container_image', application_id, 'pds') }}
{% include 'roles/sys-svc-container/templates/base.yml.j2' %}
{{ lookup('container_volumes', service_name) | indent(4) }}
{{ lookup('container_ports', ['api', 'http', DOCKER_BIND_HOST]) | indent(4) }}
{{ lookup('container_healthcheck', 'api') | indent(4) }}
{{ lookup('container_extra_hosts') | indent(4) }}
{{ lookup('container_networks') | indent(4) }}
{% if BLUESKY_WEB_ENABLED %}
{% set service_name = 'web' %}
{{ service_name }}:
{% include 'roles/sys-svc-container/templates/deploy.yml.j2' %}
command: ["bskyweb","serve"]
build:
context: "{{ BLUESKY_SOCIAL_APP_DIR }}"
dockerfile: Dockerfile
{{ lookup('container_image', application_id, 'web', image=BLUESKY_WEB_IMAGE_CUSTOM) }}
{{ lookup('compose_only', 'pull_policy', 'never') }}
{{ lookup('compose_restart') }}
{{ lookup('container_ports', ['web', 'http', DOCKER_BIND_HOST]) | indent(4) }}
{{ lookup('container_healthcheck', service_name) | indent(4) }}
{{ lookup('container_extra_hosts') | indent(4) }}
{{ lookup('container_networks') | indent(4) }}
{% set service_name = BLUESKY_BROKER_SERVICE %}
{{ service_name }}:
{% include 'roles/sys-svc-container/templates/deploy.yml.j2' %}
build:
context: "{{ BLUESKY_BROKER_BUILD_CONTEXT }}"
dockerfile: Dockerfile
args:
BLUESKY_BROKER_BASE_IMAGE: "{{ BLUESKY_BROKER_BASE_IMAGE }}"
BLUESKY_BROKER_BASE_VERSION: "{{ BLUESKY_BROKER_BASE_VERSION }}"
{{ lookup('container_image', application_id, BLUESKY_BROKER_SERVICE, image=BLUESKY_BROKER_IMAGE) }}
{{ lookup('compose_only', 'container_name', BLUESKY_BROKER_CONTAINER) }}
hostname: {{ service_name }}
{{ lookup('compose_only', 'pull_policy', 'never') }}
{{ lookup('compose_restart') }}
{{ lookup('container_ports', [BLUESKY_BROKER_SERVICE, 'http', DOCKER_BIND_HOST]) | indent(4) }}
environment:
BROKER_PORT: "{{ BLUESKY_BROKER_INTERNAL_PORT }}"
SOCIAL_APP_URL: "http://web:{{ BLUESKY_WEB_INTERNAL_PORT }}"
PDS_URL: "{{ lookup('tls', application_id, 'protocols.web') }}://{{ BLUESKY_API_DOMAIN }}"
PDS_INTERNAL_URL: "http://pds:{{ BLUESKY_PDS_INTERNAL_PORT }}"
PDS_HANDLE_DOMAIN: "{{ BLUESKY_PDS_HANDLE_DOMAIN }}"
PDS_ADMIN_PASSWORD: "{{ BLUESKY_ADMIN_PASSWORD | replace('$', '$$') }}"
BLUESKY_BRIDGE_ENCRYPTION_KEY: "{{ BLUESKY_BRIDGE_ENCRYPTION_KEY }}"
INSECURE_TLS: "{{ MODE_DEBUG | string | lower }}"
healthcheck:
test: ["CMD", "wget", "-q", "-O-", "http://127.0.0.1:{{ BLUESKY_BROKER_INTERNAL_PORT }}/healthz"]
interval: 2m
timeout: 5s
retries: 3
start_period: 10m
start_interval: 5s
{{ lookup('container_extra_hosts') | indent(4) }}
{{ lookup('container_networks') | indent(4) }}
{% endif %}
{{ lookup('compose_volumes') }}
{{ lookup('compose_networks') }}