diff --git a/Dockerfile b/Dockerfile index 32d019b..1a1da26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,7 @@ FROM python:3.10.0 RUN apt update RUN apt install git nginx libnginx-mod-rtmp ffmpeg -y -# mkdir -p for /logs/nginx didn't seem to work for some reason?? -RUN mkdir /logs && mkdir /logs/nginx && mkdir /archive && mkdir /hls +RUN mkdir /archive && mkdir /hls COPY ./docker/nginx.conf /etc/nginx/nginx.conf COPY ./docker/startup.sh /startup.sh @@ -13,7 +12,6 @@ WORKDIR /app # RUN git clone https://github.com/GOATS2K/overpass.git . COPY ../ . RUN pip3 install . -RUN flask init-db --yes EXPOSE 8000 EXPOSE 1935 diff --git a/docker/nginx.conf b/docker/nginx.conf index 40a6cf5..fd3cc36 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -33,8 +33,8 @@ http { '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent"'; - access_log /logs/nginx/access.log; - error_log /logs/nginx/error.log; + access_log /var/log/nginx/access.log; + error_log /var/log/nginx/error.log; ## # Gzip Settings diff --git a/docker/startup.sh b/docker/startup.sh index a82c07d..22365bc 100644 --- a/docker/startup.sh +++ b/docker/startup.sh @@ -1,3 +1,8 @@ #!/bin/bash +if [ ! -f /app/overpass.db ]; then + cd /app + flask init-db --yes +fi + nginx & gunicorn app:app --workers=2 --threads=4 --worker-class=gthread --timeout=600 --bind=0.0.0.0 \ No newline at end of file