diff --git a/.env b/.env new file mode 100644 index 0000000..9096285 --- /dev/null +++ b/.env @@ -0,0 +1,6 @@ +REDIS_HOST=redis +REDIS_PORT=6379 +WEBSOCKET_LISTEN=0.0.0.0 +WEBSOCKET_PORT=6789 +RTMP_HOST=rtmp +RTMP_PORT=1935 diff --git a/docker-compose.yml b/docker-compose.yml index 06cf4b4..6bbf9ae 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,22 +4,36 @@ services: build: context: . entrypoint: poetry run python src/server.py + restart: unless-stopped + environment: + - REDIS_HOST=$REDIS_HOST + - REDIS_PORT=$REDIS_PORT + - WEBSOCKET_LISTEN=$WEBSOCKET_LISTEN + - WEBSOCKET_PORT=$WEBSOCKET_PORT ports: - - 6789:6789 + - $WEBSOCKET_PORT:$WEBSOCKET_PORT depends_on: - "redis" emulator: build: context: . entrypoint: poetry run python src/emulator.py + restart: unless-stopped + environment: + - REDIS_HOST=$REDIS_HOST + - REDIS_PORT=$REDIS_PORT + - RTMP_HOST=$RTMP_HOST + - RTMP_PORT=$RTMP_PORT depends_on: - "rtmp" - "redis" redis: image: "redis:alpine" + restart: unless-stopped ports: - - 6379:6379 + - $REDIS_PORT:6379 rtmp: image: "tiangolo/nginx-rtmp" + restart: unless-stopped ports: - - 1935:1935 + - $RTMP_PORT:1935 diff --git a/src/client.html b/src/client.html index e9a7da9..7e59e3d 100644 --- a/src/client.html +++ b/src/client.html @@ -79,7 +79,7 @@