Feat: allow defining extra nginx container vols, service prerequisites and group

This commit is contained in:
Ana Custura 2025-08-08 17:01:31 +01:00
parent 051c1ab57f
commit b25959fdb7
2 changed files with 19 additions and 1 deletions

View file

@ -3,4 +3,7 @@ podman_nginx_additional_hostnames: []
podman_nginx_certbot_testing: false podman_nginx_certbot_testing: false
# podman_nginx_frontend_network: # podman_nginx_frontend_network:
podman_nginx_podman_rootless_user: nginx podman_nginx_podman_rootless_user: nginx
# podman_nginx_systemd_service_slice:
# podman_nginx_primary_hostname: # podman_nginx_primary_hostname:
podman_nginx_systemd_service_requires: []
podman_nginx_additional_volumes: []

View file

@ -7,10 +7,25 @@ PublishPort=443:443
Volume=/home/{{ podman_nginx_podman_rootless_user }}/certbot/www:/var/www/certbot/:ro Volume=/home/{{ podman_nginx_podman_rootless_user }}/certbot/www:/var/www/certbot/:ro
Volume=/home/{{ podman_nginx_podman_rootless_user }}/certbot/conf/:/etc/letsencrypt/:ro Volume=/home/{{ podman_nginx_podman_rootless_user }}/certbot/conf/:/etc/letsencrypt/:ro
Volume=/home/{{ podman_nginx_podman_rootless_user }}/nginx:/etc/nginx/conf.d/:ro Volume=/home/{{ podman_nginx_podman_rootless_user }}/nginx:/etc/nginx/conf.d/:ro
{% for item in podman_nginx_additional_volumes %}
Volume={{ item.src }}:{{ item.dest }}:{{ item.options }}
{% endfor %}
{% if podman_nginx_systemd_service_requires is defined and podman_nginx_systemd_service_requires|length > 0 %}
[Unit]
{% for req in podman_nginx_systemd_service_requires %}
Requires={{ req }}.service
After={{ req }}.service
{% endfor %}
{% endif %}
[Service] [Service]
RuntimeMaxSec=604800 RuntimeMaxSec=604800
Restart=always Restart=always
{% if podman_nginx_systemd_service_slice is defined %}
Slice={{ podman_nginx_systemd_service_slice }}
{% else %}
[Install] [Install]
WantedBy=default.target WantedBy=default.target
{% endif %}