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

33 lines
1.1 KiB
Plaintext
Raw Permalink 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 }}"
2024-07-18 18:46:42 +00:00
restart: unless-stopped
2023-11-10 13:47:57 +00:00
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 }}/{{ site.domain }}:/public
2023-11-10 13:47:57 +00:00
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