1
0
mirror of https://github.com/daniviga/bite.git synced 2025-04-20 14:31:20 +02:00

Fix nginx and pre-compile python to speedup start

This commit is contained in:
Daniele Viganò 2020-06-26 17:42:47 +02:00
parent 61fd6263f1
commit 1d1fd4e5f2
Signed by: dani
GPG Key ID: DB49AFC03C40EE02
2 changed files with 5 additions and 4 deletions

View File

@ -35,6 +35,7 @@ COPY --chown=1000:1000 bite /srv/app/bite
COPY --chown=1000:1000 requirements.txt /srv/app/bite/requirements.txt
RUN pip3 install -r /srv/app/bite/requirements.txt \
&& python3 -m compileall -q /srv/app/bite \
&& mkdir -p /srv/appdata/bite/static \
&& chown -R 1000:1000 /srv/appdata/bite

View File

@ -48,13 +48,13 @@ http {
'' close;
}
upstream bite {
upstream django {
# We point to the Docker 'service' instead of directly to the container
# Docker does then a DNS round-robin internally
server bite:8000;
}
upstream broker {
upstream mqtt {
# We point to the Docker 'service' instead of directly to the container
# Docker does then a DNS round-robin internally
server broker:9001;
@ -69,7 +69,7 @@ http {
keepalive_timeout 60 60;
location / {
proxy_pass http://bite;
proxy_pass http://django;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
@ -85,7 +85,7 @@ http {
}
location /mqtt {
proxy_pass http://broker;
proxy_pass http://mqtt;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;