Skip to content

Commit

Permalink
nginx/ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
dferrante committed Nov 26, 2023
1 parent 56ac5db commit a5aea84
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ local_config.*
.python-version
*.vscode*
whisper*
*.pem
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM python:3.10-slim
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get -qq update \
&& apt-get -qq install --no-install-recommends \
ffmpeg gcc git supervisor
ffmpeg gcc git supervisor nginx

# install python requirements
RUN pip install -U pip setuptools
Expand All @@ -20,5 +20,6 @@ COPY airports.dat acro.json __init__.py pythabot.py pywx.py transcribe_alerts.py
# setup supervisord
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY nginx.conf /etc/nginx/sites-available/default

CMD ["/usr/bin/supervisord"]
10 changes: 10 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
server {
listen 443 ssl;
ssl_certificate /data/fullchain.pem;
ssl_certificate_key /data/privkey.pem;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header X-Real-IP $remote_addr;
}
}
10 changes: 9 additions & 1 deletion supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ stdout_logfile_maxbytes=0
redirect_stderr=true

[program:waitress]
command=waitress-serve webscanner:app
command=waitress-serve --url-scheme=https webscanner:app
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true

[program:nginx]
command=/usr/sbin/nginx -g "daemon off;"
autostart=true
autorestart=unexpected
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
4 changes: 0 additions & 4 deletions webscanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,3 @@ def list():
reply = template.render({'events': events})

return reply


if __name__ == '__main__':
print(list())

0 comments on commit a5aea84

Please sign in to comment.