{% include 'roles/docker-compose/templates/base.yml.j2' %}

  application:
{% set container_port = 9000 %}
    image: {{ PEERTUBE_IMAGE }}:{{ PEERTUBE_VERSION }}
    container_name: {{ PEERTUBE_CONTAINER }}
{% include 'roles/docker-container/templates/base.yml.j2' %}
    ports:
     - "1935:1935"  # @todo Add to ports
     - "127.0.0.1:{{ ports.localhost.http[application_id] }}:{{ container_port }}" 
    volumes:
      - assets:/app/client/dist
      - data:/data
      - config:/config
    environment:
      - NODE_OPTIONS=--max-old-space-size={{ PEERTUBE_MAX_OLD_SPACE_SIZE }}
      - PEERTUBE_TRANSCODING_CONCURRENCY={{ PEERTUBE_TRANSCODING_CONCURRENCY }}
    shm_size: "512m"
    tmpfs:
      - /tmp:size=1g,exec
    ulimits:
      nofile:
        soft: 131072
        hard: 131072
      nproc:  8192
{% include 'roles/docker-container/templates/depends_on/dmbs_excl.yml.j2' %}
{% include 'roles/docker-container/templates/networks.yml.j2' %}
{% include 'roles/docker-container/templates/healthcheck/tcp.yml.j2' %}
{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
  assets:
  data:
    name: {{ PEERTUBE_DATA_VOLUME }}
  config:
    name: {{ PEERTUBE_CONFIG_VOLUME }}

{% include 'roles/docker-compose/templates/networks.yml.j2' %}