Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix nginx and python issue when running on docker #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/openqa_data/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM opensuse/leap:15.2
LABEL maintainer Jan Sedlak <[email protected]>, Josef Skladanka <[email protected]>, wnereiz <[email protected]>, Sergio Lindo Mansilla <[email protected]>
LABEL version="0.3"

RUN zypper --non-interactive in ca-certificates-mozilla git wget
RUN zypper --non-interactive in ca-certificates-mozilla git wget python

ADD data.template /data
ADD scripts /scripts
Expand Down
9 changes: 5 additions & 4 deletions docker/webui/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ services:
depends_on:
- data
- db
deploy:
replicas: ${OPENQA_WEBUI_REPLICAS}
#deploy:
#replicas: ${OPENQA_WEBUI_REPLICAS}

db:
image: postgres
Expand All @@ -96,8 +96,9 @@ services:
- "9526:9526"
# Uncomment for SSL access
# - "443:443"
environment:
replicas: ${OPENQA_WEBUI_REPLICAS}
#environment:
#replicas: ${OPENQA_WEBUI_REPLICAS}
#volumes:
# If is needed to set a certificate for SSL
# - cert.crt:/etc/ssl/certs/opeqa.crt
# - cert.key:/etc/ssl/certs/opeqa.key
8 changes: 1 addition & 7 deletions docker/webui/nginx-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
#!/bin/bash
set -e

replicas=""
for i in $(seq 2 $replicas); do
replicas="server webui_webui_$i:9526;$replicas"
done

reg="s/REPLICAS/$replicas/"
sed "$reg" /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
cp /etc/nginx/conf.d/default.conf.template /etc/nginx/conf.d/default.conf

cat /etc/nginx/conf.d/default.conf

Expand Down
12 changes: 4 additions & 8 deletions docker/webui/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
upstream webui {
REPLICAS
}

server {
listen 80;
listen 443;
listen 9526;

server_name localhost;
client_max_body_size 0;

Expand All @@ -14,7 +10,7 @@ server {
# ssl_certificate_key /etc/ssl/certs/openqa.key;

location /api/v1/ws/ {
proxy_pass http://webui_websockets_1:9527;
proxy_pass http://websockets:9527;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
Expand All @@ -24,7 +20,7 @@ server {
}

location /liveviewhandler/ {
proxy_pass http://webui_livehandler_1:9528;
proxy_pass http://livehandler:9528;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
Expand All @@ -41,6 +37,6 @@ server {
proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://webui;
proxy_pass http://webui:9526;
}
}