# This file has been autogenerated. It is highly recommended to not edit it directly.
# Instead, if you need to do customizations, please consider using a "docker-compose.override.yaml" file.

version: "2.4"

{% if environment_for_docker_compose_file|length > 0 %}
x-env: &env_var
{% for item in environment_for_docker_compose_file %}
  {{item}}: "{{environment_for_docker_compose_file[item]}}"
{% endfor %}

{% endif %}
x-logging: &logging_var
  logging:
    driver: "json-file"
    options:
      max-size: "50m"
      max-file: "10"

services:
{% for service in services %}
  {{ service.name }}:
    image: "{{ service.image }}"
{% if service.environment|length > 0 or environment_for_docker_compose_file|length > 0 %}
    environment:
{% if environment_for_docker_compose_file|length > 0 %}
      <<: *env_var
{% endif %}
{% for item in service.environment %}
      {{item}}: "{{service.environment[item]}}"
{% endfor %}
{% endif %}
{% if env_file %}
    env_file:
      - .env
{% endif %}
{% if service.ports|length > 0 %}
    ports:
{% for item in service.ports %}
      - "{{ item }}"
{% endfor %}
{% endif %}
{% if service.volumes|length > 0 %}
    volumes:
{% for item in service.volumes %}
      - "{{ item }}"
{% endfor %}
{% endif %}
{% if service.tmpfs|length > 0 %}
    tmpfs:
{% for item in service.tmpfs %}
      - "{{ item }}"
{% endfor %}
{% endif %}
{% if service.privileged %}
    privileged: true
{% endif %}
    networks:
      - "{{ docker_net_name }}"
    restart: always

{% endfor %}
networks:
  {{ docker_net_name }}:
