This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM python:3.10.0 | ||
|
||
RUN apt update | ||
RUN apt install git nginx libnginx-mod-rtmp ffmpeg -y | ||
|
||
COPY ./docker/nginx.conf /etc/nginx/nginx.conf | ||
|
||
WORKDIR /app | ||
RUN git clone https://github.com/GOATS2K/overpass.git . | ||
COPY .env /app/ | ||
RUN pip3 install . | ||
RUN flask init-db | ||
|
||
EXPOSE 8000 | ||
EXPOSE 1935 | ||
|
||
CMD ["gunicorn", "app:app", "--workers=2", "--threads=4", "--worker-class=gthread", "--timeout=600", "--bind=0.0.0.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
services: | ||
overpass: | ||
build: . | ||
container_name: overpass | ||
environment: | ||
- HLS_PATH=/hls | ||
- REC_PATH=/archive | ||
- OVERPASS_SECRET_KEY=example_key_1337 | ||
- RTMP_SERVER="127.0.0.1:1935/live" | ||
- DISCORD_CLIENT_ID=yourclientid | ||
- DISCORD_CLIENT_SECRET=yourclientsecret | ||
- DISCORD_REDIRECT_URI=yourredirecturi | ||
- DISCORD_GUILD_ID=yoursecretguildid | ||
volumes: | ||
- /Users/jpg/Container Data/overpass/log:/logs:rw | ||
- /Users/jpg/Container Data/overpass/archive:/archive:rw | ||
- /Users/jpg/Container Data/overpass/hls:/hls:rw | ||
ports: | ||
- 1935:1935 | ||
- 8000:8000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
user www-data; | ||
worker_processes auto; | ||
pid /run/nginx.pid; | ||
include /etc/nginx/modules-enabled/*.conf; | ||
rtmp_auto_push on; | ||
|
||
events { | ||
worker_connections 4096; | ||
# multi_accept on; | ||
} | ||
|
||
http { | ||
|
||
## | ||
# Basic Settings | ||
## | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
keepalive_timeout 65; | ||
types_hash_max_size 2048; | ||
|
||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
## | ||
# Logging Settings | ||
## | ||
|
||
log_format '$remote_addr - $remote_user [$time_local] ' | ||
'"$request" $status $body_bytes_sent ' | ||
'"$http_referer" "$http_user_agent"'; | ||
|
||
access_log /logs/nginx/access.log; | ||
error_log /logs/nginx/error.log; | ||
|
||
## | ||
# Gzip Settings | ||
## | ||
|
||
gzip on; | ||
|
||
## | ||
# Virtual Host Configs | ||
## | ||
|
||
include /etc/nginx/conf.d/*.conf; | ||
include /etc/nginx/sites-enabled/*; | ||
} | ||
|
||
rtmp { | ||
server { | ||
listen 0.0.0.0:1935; | ||
on_publish http://127.0.0.1:8000/api/rtmp/connect; | ||
on_publish_done http://127.0.0.1:8000/api/rtmp/done; | ||
|
||
application live { | ||
live on; | ||
record all; | ||
record_path /archive; | ||
record_append on; | ||
|
||
hls on; | ||
hls_path /hls; | ||
hls_fragment 2s; | ||
hls_playlist_length 10s; | ||
exec_record_done bash -c "/usr/bin/ffmpeg -i $path -acodec copy -vcodec copy -movflags +faststart /archive/$basename.mp4 && rm $path"; | ||
} | ||
} | ||
} |