[Unit]
Description=Freva web Porxy server
After=network.target

[Service]
Type=simple
{% if (ansible_become == true and ansible_become_user == 'root') or ansible_user == 'root' %}
ProtectHome=true
ProtectSystem=full
{% endif %}
RuntimeDirectory=nginx-tmp
RuntimeDirectoryMode=0755
Environment=RUNTIME_DIR=/run/nginx-tmp
ReadWritePaths={{conda_path }}
PermissionsStartOnly=true
NoNewPrivileges=true
KillSignal=SIGTERM
ExecStart={{bash_cmd }} -c "{{conda_path}}/bin/start-freva-service -s nginx"
EnvironmentFile={{ data_dir }}/config/service-web.env
Environment="PATH={{conda_path}}/bin:{{ ansible_env.PATH }}"
StandardOutput=journal
StandardError=journal
Restart=on-failure
RestartSec=5
StartLimitBurst=5
UMask=007
[Install]
WantedBy=multi-user.target
