From 3ae9fe54052681dd562d290dab9f20b4609a3ad7 Mon Sep 17 00:00:00 2001 From: Lickitysplitted Date: Thu, 31 Mar 2022 23:43:24 -0500 Subject: [PATCH] =?UTF-8?q?Modify=20Dockerfile=20and=20the=20nginx.conf=20?= =?UTF-8?q?file=20to=20avoid=20Nginx=20default=20conf=E2=80=A6=20(#203)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Modify Dockerfile and the nginx.conf file to avoid Nginx default config IPv6 conflict. * Adjust nginx.conf name and run.sh nginx modification. * but nginx.conf file back Co-authored-by: simon --- Dockerfile | 2 +- docker_assets/nginx.conf | 13 ++++++------- docker_assets/run.sh | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6dfbff4..3aa93b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,7 +44,7 @@ COPY ./tubearchivist/requirements.txt /requirements.txt RUN pip install --no-cache-dir -r requirements.txt --src /usr/local/src # copy config files -COPY docker_assets/nginx.conf /etc/nginx/conf.d/ +COPY docker_assets/nginx.conf /etc/nginx/sites-available/default # copy application into container COPY ./tubearchivist /app diff --git a/docker_assets/nginx.conf b/docker_assets/nginx.conf index 2bf3241..e134a8e 100644 --- a/docker_assets/nginx.conf +++ b/docker_assets/nginx.conf @@ -1,30 +1,29 @@ server { listen 8000; - + location /cache/videos/ { alias /cache/videos/; } - + location /cache/channels/ { alias /cache/channels/; } - + location /cache/playlists/ { alias /cache/playlists/; } - + location /media/ { alias /youtube/; - types { text/vtt vtt; } } - + location / { include uwsgi_params; uwsgi_pass localhost:8080; } - + } \ No newline at end of file diff --git a/docker_assets/run.sh b/docker_assets/run.sh index 747548c..31022c7 100644 --- a/docker_assets/run.sh +++ b/docker_assets/run.sh @@ -15,11 +15,11 @@ done # ugly nginx and uwsgi port overwrite with env vars if [[ -n "$TA_PORT" ]]; then - sed -i "s/8000/$TA_PORT/g" /etc/nginx/conf.d/nginx.conf + sed -i "s/8000/$TA_PORT/g" /etc/nginx/sites-available/default fi if [[ -n "$TA_UWSGI_PORT" ]]; then - sed -i "s/8080/$TA_UWSGI_PORT/g" /etc/nginx/conf.d/nginx.conf + sed -i "s/8080/$TA_UWSGI_PORT/g" /etc/nginx/sites-available/default sed -i "s/8080/$TA_UWSGI_PORT/g" /app/uwsgi.ini fi