Modify Dockerfile and the nginx.conf file to avoid Nginx default conf… (#203)

* 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 <simobilleter@gmail.com>
This commit is contained in:
Lickitysplitted 2022-03-31 23:43:24 -05:00 committed by GitHub
parent 12fa5748d4
commit 3ae9fe5405
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 10 deletions

View File

@ -44,7 +44,7 @@ COPY ./tubearchivist/requirements.txt /requirements.txt
RUN pip install --no-cache-dir -r requirements.txt --src /usr/local/src RUN pip install --no-cache-dir -r requirements.txt --src /usr/local/src
# copy config files # 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 application into container
COPY ./tubearchivist /app COPY ./tubearchivist /app

View File

@ -1,30 +1,29 @@
server { server {
listen 8000; listen 8000;
location /cache/videos/ { location /cache/videos/ {
alias /cache/videos/; alias /cache/videos/;
} }
location /cache/channels/ { location /cache/channels/ {
alias /cache/channels/; alias /cache/channels/;
} }
location /cache/playlists/ { location /cache/playlists/ {
alias /cache/playlists/; alias /cache/playlists/;
} }
location /media/ { location /media/ {
alias /youtube/; alias /youtube/;
types { types {
text/vtt vtt; text/vtt vtt;
} }
} }
location / { location / {
include uwsgi_params; include uwsgi_params;
uwsgi_pass localhost:8080; uwsgi_pass localhost:8080;
} }
} }

View File

@ -15,11 +15,11 @@ done
# ugly nginx and uwsgi port overwrite with env vars # ugly nginx and uwsgi port overwrite with env vars
if [[ -n "$TA_PORT" ]]; then 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 fi
if [[ -n "$TA_UWSGI_PORT" ]]; then 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 sed -i "s/8080/$TA_UWSGI_PORT/g" /app/uwsgi.ini
fi fi