Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
fix(dockerfile): run init-db only when no database exists
Browse files Browse the repository at this point in the history
  • Loading branch information
GOATS2K committed Dec 2, 2021
1 parent b501497 commit 04486cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docker/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions docker/startup.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 04486cd

Please sign in to comment.