49 lines
1.1 KiB
Django/Jinja
49 lines
1.1 KiB
Django/Jinja
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
|
|
# 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
|
|
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
|