Files
docker-compose-collection/app/template.yml.j2
Mickael Asseline 9d819223ef Add description, hint and default value for variable (#20)
* a fix

* add description, hint and default value for variable

* add description, hint and default value for variable
2023-01-13 21:18:17 +01:00

73 lines
2.3 KiB
Django/Jinja

# Maintainer: {{ maintainer_name }} - {{ maintainer_github }}
# Update: {{ update_date }}
#& type: 3
#& title: {{ app_name }}
#& description: {{ app_description }}
#& note: Website: <a href='{{ app_url }}' target='_blank' rel='noopener'>Github.com</a>
#& categories: SelfHosted, PAPAMICA
#& platform: linux
#& logo: {{ app_logo }}
#% SERVICE: Name of the service (No spaces or points) [{{ app_name|lower }}]
#% DATA_LOCATION: Data localization (Example: /apps/service) [/_data/apps]
#% URL: Service URL (Example: service.papamica.fr or service.com)
#% NETWORK: Your Traefik network (Example: proxy) [proxy]
{%- if envvar is defined and envvar|length > 0 %}
{%- for var in envvar %}
{%- if not loop.last %}
#% {{ var[0]|upper }}: {{ var[1] }} ({{ var[2] }}) [{{ var[3] }}]
{%- endif %}
{%- if loop.last %}
#% {{ var[0]|upper }}: {{ var[1] }} ({{ var[2] }}) [{{ var[3] }}]
{%- endif %}
{%- endfor %}
{%- endif %}
# Work with Portainer
version: '3.8'
services:
{{ app_name|lower }}:
image: {{ app_image }}
{%- if volumlist is defined and envvar|length > 0 %}
volumes:
{%- for var in volumlist %}
{%- if not loop.last %}
- $DATA_LOCATION/$SERVICE/{{ var }}
{%- endif %}
{%- if loop.last %}
- $DATA_LOCATION/$SERVICE/{{ var }}
{%- endif -%}
{%- endfor %}
{%- endif %}
{%- if envvar is defined and envvar|length > 0 %}
environment:
{%- for var in envvar %}
{%- if not loop.last %}
- {{ var[0]|upper }}:${{ var[0]|upper }}
{%- endif %}
{%- if loop.last %}
- {{ var[0]|upper }}:${{ var[0]|upper }}
{%- endif %}
{%- endfor %}
{%- endif %}
healthcheck:
test: wget -s 'http://localhost:{{ app_port }}'
interval: 1m
timeout: 30s
retries: 3
container_name: $SERVICE
networks:
- default
labels:
- "autoupdate=monitor" # https://github.com/PAPAMICA/container-updater
- "traefik.enable=true"
- "traefik.http.routers.$SERVICE.entrypoints=https"
- "traefik.http.routers.$SERVICE.rule=Host(`$URL`)"
- "traefik.http.routers.$SERVICE.tls.certresolver=http"
- "traefik.http.services.$SERVICE.loadbalancer.server.port={{ app_port }}"
networks:
default:
external:
name: $NETWORK