Created
July 7, 2022 11:19
-
-
Save 1vank1n/12c26c9e9ca73b1a820133166c8f6d74 to your computer and use it in GitHub Desktop.
Template configs for production launch Django project / il-studio.ru
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd /web/project/ | |
| source /web/project/.env/bin/activate | |
| git pull | |
| pip install -r requirements/staging.txt | |
| python ./manage.py migrate | |
| python ./manage.py collectstatic --noinput | |
| # python ./manage.py test | |
| touch /tmp/project.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name project.ru; | |
| rewrite_log on; | |
| error_log /web/log/nginx/project.ru-error.log warn; | |
| access_log /web/log/nginx/project.ru-access.log; | |
| location /static/ { | |
| alias /web/project/static_nginx/; | |
| expires 1y; | |
| } | |
| location /media/ { | |
| root /web/project; | |
| expires 1y; | |
| } | |
| location /robots.txt { | |
| root /web/project; | |
| } | |
| location /.well-known { | |
| root /web/project; | |
| } | |
| location / { | |
| include uwsgi_params; | |
| uwsgi_pass unix:/web/run/project.sock; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [program:project] | |
| command=/web/project/.env/bin/uwsgi /web/project/uwsgi.ini | |
| stdout_logfile=/web/log/uwsgi/project.log | |
| stderr_logfile=/web/log/uwsgi/project_err.log | |
| autostart=true | |
| autorestart=true | |
| redirect_stderr=true | |
| stopwaitsecs=60 | |
| stopsignal=INT | |
| user=web |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [uwsgi] | |
| home=/web/project/.env | |
| chdir=/web/project | |
| module=settings.wsgi:application | |
| master=True | |
| disable-logging=True | |
| pidfile=/web/pid/project.pid | |
| socket=/web/run/project.sock | |
| vacuum=True | |
| max-requests=5000 | |
| uid=web | |
| gid=web | |
| chmod-socket=666 | |
| touch-reload=/tmp/project.conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment