mirror of https://github.com/doccano/doccano.git
Browse Source
Merge pull request #1379 from doccano/fix/dockerCompose
Merge pull request #1379 from doccano/fix/dockerCompose
Fix docker-compose.prod.ymlpull/1382/head
Hiroki Nakayama
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 120 additions and 65 deletions
Split View
Diff Options
-
1backend/.dockerignore
-
16backend/Dockerfile.prod
-
2docker-compose.prod.yml
-
16nginx/Dockerfile
-
57nginx/default.conf
-
88nginx/nginx.conf
-
4tools/offline_deployment/offline_01_1-optional_use_https.sh
-
1tools/prod-django.sh
@ -0,0 +1,57 @@ |
|||
server { |
|||
listen 8080; |
|||
charset utf-8; |
|||
client_max_body_size 100M; |
|||
add_header X-Frame-Options DENY; |
|||
add_header X-Content-Type-Options nosniff; |
|||
add_header X-XSS-Protection "1; mode=block"; |
|||
|
|||
location / { |
|||
root /var/www/html; |
|||
try_files $uri /index.html; |
|||
} |
|||
|
|||
location /v1/ { |
|||
proxy_pass http://backend:8000/v1/; |
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|||
proxy_set_header Host $host; |
|||
proxy_redirect off; |
|||
proxy_read_timeout 300; |
|||
} |
|||
|
|||
location /admin/ { |
|||
proxy_pass http://backend:8000/admin/; |
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|||
proxy_set_header Host $host; |
|||
proxy_redirect off; |
|||
} |
|||
|
|||
location = /admin { |
|||
absolute_redirect off; |
|||
return 301 /admin/; |
|||
} |
|||
|
|||
location /swagger/ { |
|||
proxy_pass http://backend:8000/swagger/; |
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|||
proxy_set_header Host $host; |
|||
proxy_redirect off; |
|||
} |
|||
|
|||
location = /swagger { |
|||
absolute_redirect off; |
|||
return 301 /swagger/; |
|||
} |
|||
|
|||
location /static/ { |
|||
autoindex on; |
|||
alias /static/; |
|||
} |
|||
|
|||
location /media/ { |
|||
autoindex on; |
|||
alias /media/; |
|||
} |
|||
} |
|||
|
|||
server_tokens off; |
@ -1,57 +1,35 @@ |
|||
server { |
|||
listen 80; |
|||
charset utf-8; |
|||
client_max_body_size 100M; |
|||
add_header X-Frame-Options DENY; |
|||
add_header X-Content-Type-Options nosniff; |
|||
add_header X-XSS-Protection "1; mode=block"; |
|||
|
|||
location / { |
|||
root /var/www/html; |
|||
try_files $uri /index.html; |
|||
} |
|||
|
|||
location /v1/ { |
|||
proxy_pass http://backend:8000/v1/; |
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|||
proxy_set_header Host $host; |
|||
proxy_redirect off; |
|||
proxy_read_timeout 300; |
|||
} |
|||
|
|||
location /admin/ { |
|||
proxy_pass http://backend:8000/admin/; |
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|||
proxy_set_header Host $host; |
|||
proxy_redirect off; |
|||
} |
|||
|
|||
location = /admin { |
|||
absolute_redirect off; |
|||
return 301 /admin/; |
|||
} |
|||
|
|||
location /swagger/ { |
|||
proxy_pass http://backend:8000/swagger/; |
|||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
|||
proxy_set_header Host $host; |
|||
proxy_redirect off; |
|||
} |
|||
|
|||
location = /swagger { |
|||
absolute_redirect off; |
|||
return 301 /swagger/; |
|||
} |
|||
|
|||
location /static/ { |
|||
autoindex on; |
|||
alias /static/; |
|||
} |
|||
|
|||
location /media/ { |
|||
autoindex on; |
|||
alias /media/; |
|||
} |
|||
worker_processes auto; |
|||
|
|||
error_log /var/log/nginx/error.log warn; |
|||
|
|||
# Change pid to allow no super user to run |
|||
pid /tmp/nginx.pid; |
|||
|
|||
|
|||
events { |
|||
worker_connections 1024; |
|||
} |
|||
|
|||
server_tokens off; |
|||
|
|||
http { |
|||
proxy_temp_path /tmp/proxy_temp; |
|||
client_body_temp_path /tmp/client_temp; |
|||
fastcgi_temp_path /tmp/fastcgi_temp; |
|||
uwsgi_temp_path /tmp/uwsgi_temp; |
|||
scgi_temp_path /tmp/scgi_temp; |
|||
|
|||
include /etc/nginx/mime.types; |
|||
default_type application/octet-stream; |
|||
|
|||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' |
|||
'$status $body_bytes_sent "$http_referer" ' |
|||
'"$http_user_agent" "$http_x_forwarded_for"'; |
|||
|
|||
access_log /var/log/nginx/access.log main; |
|||
|
|||
sendfile on; |
|||
|
|||
keepalive_timeout 65; |
|||
|
|||
include /etc/nginx/conf.d/*.conf; |
|||
} |
Write
Preview
Loading…
Cancel
Save