Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
C
cp_video_dokku
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alexandr Dzehil
cp_video_dokku
Commits
7606c7ba
You need to sign in or sign up before continuing.
Commit
7606c7ba
authored
Mar 23, 2023
by
Ilya Simonov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add server settings
parent
5cb27a0e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
0 deletions
+65
-0
restart.sh
server_configs/restart.sh
+3
-0
gunicorn.service
server_configs/testing/gunicorn.service
+8
-0
gunicornd.py
server_configs/testing/gunicornd.py
+24
-0
nginx
server_configs/testing/nginx
+30
-0
No files found.
server_configs/restart.sh
0 → 100755
View file @
7606c7ba
#!/bin/bash
sudo
service cp_video_gunicorn restart
server_configs/testing/gunicorn.service
0 → 100644
View file @
7606c7ba
[Unit]
Description=Gunicorn instance to serve cp_video
[Service]
User=django
WorkingDirectory=/home/django/clutchpoints_projects/cp_video
ExecStart=/usr/local/bin/gunicorn --config server_configs/production/gunicornd.py cp_video.wsgi:application
[Install]
WantedBy=multi-user.target
server_configs/testing/gunicornd.py
0 → 100644
View file @
7606c7ba
"""gunicorn WSGI server configuration."""
import
os
from
multiprocessing
import
cpu_count
PROJECT_DIR
=
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)))
LOGS_DIR
=
os
.
path
.
join
(
PROJECT_DIR
,
'logs'
)
if
not
os
.
path
.
exists
(
LOGS_DIR
):
os
.
makedirs
(
LOGS_DIR
)
def
max_workers
():
return
cpu_count
()
*
2
+
1
bind
=
'127.0.0.1:9001'
timeout
=
60
max_requests
=
1000
worker_class
=
'gevent'
workers
=
max_workers
()
accesslog
=
os
.
path
.
join
(
LOGS_DIR
,
'access.log'
)
errorlog
=
os
.
path
.
join
(
LOGS_DIR
,
'error.log'
)
server_configs/testing/nginx
0 → 100644
View file @
7606c7ba
upstream cp_cp_video_gunicorn {
server 127.0.0.1:9001 fail_timeout=0;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
server_name 165.227.118.167;
root /usr/share/nginx/html;
index index.html index.htm;
# your Django project's static files - amend as required
location /static {
alias /home/django/clutchpoints_projects/cp_video/static;
}
location / {
proxy_send_timeout 60;
proxy_read_timeout 60;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_pass http://cp_video_gunicorn;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment