ansible/roles/hugo/templates/docker-compose.yml.j2

53 lines
1.2 KiB
Plaintext
Raw Normal View History

2021-05-27 03:38:08 +02:00
version: "{{ compose_version }}"
networks:
proxy:
name: "{{ traefik_network }}"
# Use a bind mount for Hugo data, easier to pull new versions of blog
volumes:
website_files:
driver: local
driver_opts:
type: none
device: "{{ hugo_website }}"
o: bind
website_public:
driver: local
driver_opts:
type: none
device: "{{ hugo_website }}/public"
o: bind
services:
builder:
container_name: hugo_builder
image: "klakegg/hugo:{{ hugo_version }}"
volumes:
- website_files:/src
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
2021-05-27 03:38:08 +02:00
# Hugo will build only
# when triggered
restart: on-failure
front:
container_name: hugo_front
image: nginx:alpine
volumes:
- website_public:/usr/share/nginx/html:ro
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
2021-05-27 03:38:08 +02:00
labels:
traefik.http.routers.hugo.entrypoints: websecure
traefik.http.routers.hugo.rule: "Host(`blog.{{ domain_name }}`)"
traefik.http.services.hugo.loadbalancer.server.port: 80
traefik.enable: true
networks:
- proxy
read_only: true
tmpfs:
- /var/cache/nginx
- /run
restart: unless-stopped