ansible-playbook-static-sit.../roles/static-server/templates/docker-compose.yml.j2

32 lines
1.0 KiB
Plaintext
Raw Normal View History

2023-11-10 13:47:57 +00:00
version: "3.3"
services:
{% for site in static_sites %}
{{ site.domain }}:
image: {{ sws_container_image }}
container_name: "{{ site.domain }}"
environment:
# Note: those envs are customizable but also optional
- SERVER_PORT=8080
- SERVER_ROOT=/public
- SERVER_LOG_LEVEL=info
volumes:
- {{ static_site_server_base_path }}/{{ site.user }}/public:/public
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.{{ site.slug }}.rule=Host(`{{ site.domain }}`)"
- "traefik.http.routers.{{ site.slug }}.service={{ site.slug }}-service"
- "traefik.http.routers.{{ site.slug }}.entrypoints=web-secure"
- "traefik.http.routers.{{ site.slug }}.tls=true"
- "traefik.http.routers.{{ site.slug }}.tls.certResolver=default"
- "traefik.http.services.{{ site.slug }}-service.loadbalancer.server.port=8080"
2023-11-10 13:47:57 +00:00
networks:
- traefik
{% endfor %}
networks:
traefik:
name: "{{ traefik_docker_network }}"
external: true