Add docker (#6)

* Add docker

* Update example

---------

Co-authored-by: Fedor Batonogov <f.batonogov@yandex.ru>
This commit is contained in:
github-actions[bot]
2024-04-27 15:53:50 +03:00
committed by GitHub
parent fab1ba15f3
commit 99088532f2
10 changed files with 324 additions and 4 deletions

20
docker/nginx.tmpl Normal file
View File

@@ -0,0 +1,20 @@
{{ range $host, $containers := groupBy $ "Env.VIRTUAL_HOST" }}
upstream {{ $host }} {
{{ range $index, $value := $containers }}
{{ with $address := index $value.Addresses 0 }}
server {{ $value.Hostname }}:{{ $address.Port }};
{{ end }}
{{ end }}
}
# конфигурация веб-сервера
server {
listen 80;
location / {
proxy_pass http://{{ $host }};
}
}
{{ end }}