Skip to content

Instantly share code, notes, and snippets.

@dvmn-tasks
Last active Apr 30, 2021
Embed
What would you like to do?
# Configuration is dased on official Gunicorn docs: https://docs.gunicorn.org/en/latest/deploy.html?highlight=systemd#systemd
[Unit]
Description=Django micro-service to serve MyIP project
After=network.target

[Service]
User=root
Group=root
WorkingDirectory=/opt/myip-multi-framework/django_project/
Environment="DJ_DEBUG=False"
Environment="DJ_ALLOWED_HOSTS=206.189.61.169"  # ! Замените адрес на свой
ExecStart=/opt/myip-multi-framework/venv/bin/gunicorn -b 206.189.61.169:8081 --workers 3 django_project.wsgi:application  # ! Замените адрес на свой
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=5
PrivateTmp=true
Restart=on-failure
RestartSec=2

[Install]
WantedBy=multi-user.target
# Configuration is dased on official Gunicorn docs: https://docs.gunicorn.org/en/latest/deploy.html?highlight=systemd#systemd
[Unit]
Description=Flask micro-service to serve MyIP project
After=network.target

[Service]
User=root
Group=root
WorkingDirectory=/opt/myip-multi-framework/flask_project/
ExecStart=/opt/myip-multi-framework/venv/bin/gunicorn -b 206.189.61.169:8080 --workers 3 app:app  # ! Замените адрес на свой
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=5
PrivateTmp=true
Restart=on-failure
RestartSec=2

[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment