-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #171 from persephone-tools/deployment-nginx
[WIP] Use nginx to serve the API
- Loading branch information
Showing
5 changed files
with
88 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# nginx-app.conf | ||
|
||
# the upstream component nginx needs to connect to | ||
upstream api { | ||
server 127.0.0.1:8080; | ||
} | ||
|
||
# configuration of the server | ||
server { | ||
# the port your site will be served on, default_server indicates that this server block | ||
# is the block to use if no blocks match the server_name | ||
listen 8080 default_server; | ||
|
||
# the domain name it will serve for | ||
server_name .example.com; # substitute your machine's IP address or FQDN | ||
charset utf-8; | ||
|
||
# max upload size | ||
client_max_body_size 100M; | ||
|
||
# uploads | ||
location /uploads { | ||
alias /home/docker/volatile/uploads; | ||
} | ||
|
||
# Finally, send all non-media requests to the API server. | ||
location / { | ||
uwsgi_pass unix:///tmp/uwsgi.sock; | ||
include uwsgi_params; | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[supervisord] | ||
logfile=/var/log/supervisord/supervisord.log ; supervisord log file | ||
logfile_maxbytes=50MB ; maximum size of logfile before rotation | ||
logfile_backups=10 ; number of backed up logfiles | ||
loglevel=info ; info, debug, warn, trace | ||
user = root | ||
|
||
[supervisorctl] | ||
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket | ||
|
||
[program:app-uwsgi] | ||
command = /usr/local/bin/uwsgi --ini /app/uwsgi.ini | ||
priority=1 | ||
|
||
[program:nginx-app] | ||
command = /usr/sbin/nginx | ||
priority=2 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[uwsgi] | ||
# this config will be loaded if nothing specific is specified | ||
# load base config from below | ||
ini = :base | ||
|
||
socket = /tmp/uwsgi.sock | ||
chmod-socket = 777 | ||
master = true | ||
processes = 4 | ||
|
||
[local] | ||
http = :8080 | ||
|
||
[base] | ||
# chdir to the folder this config file resides in | ||
# %d is the dir this configuration file is in | ||
chdir=%d | ||
module=transcription_API_server:app |