diff --git a/docker/Dockerfile b/docker/Dockerfile index 11cdc261..93b13950 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ ### Stage 1: Build the frontend -FROM --platform=linux/amd64 node:20 as build-frontend +FROM node:20 as build-frontend USER node diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 5a5434db..62394a03 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -9,20 +9,24 @@ terminate_process() { # Trap termination signals trap terminate_process TERM INT -if [ -z "${LIVEKIT_URL}" ]; then - echo "LIVEKIT_URL is required" - echo "example: docker run -e LIVEKIT_URL=https://livekit-server:7880 -e LIVEKIT_API_KEY=api_key -e LIVEKIT_API_SECRET=api_secret -p 6080:6080 openvidu-call" - exit 1 -fi -if [ -z "${LIVEKIT_API_KEY}" ]; then - echo "LIVEKIT_API_KEY is required" - echo "example: docker run -e LIVEKIT_URL=https://livekit-server:7880 -e LIVEKIT_API_KEY=api_key -e LIVEKIT_API_SECRET=api_secret -p 6080:6080 openvidu-call" - exit 1 -fi -if [ -z "${LIVEKIT_API_SECRET}" ]; then - echo "LIVEKIT_API_SECRET is required" - echo "example: docker run -e LIVEKIT_URL=https://livekit-server:7880 -e LIVEKIT_API_KEY=api_key -e LIVEKIT_API_SECRET=api_secret -p 6080:6080 openvidu-call" - exit 1 +# If a custom config directory is not provided, +# check minimal required environment variables +if [ -z "${CALL_CONFIG_DIR}" ]; then + if [ -z "${LIVEKIT_URL}" ]; then + echo "LIVEKIT_URL is required" + echo "example: docker run -e LIVEKIT_URL=https://livekit-server:7880 -e LIVEKIT_API_KEY=api_key -e LIVEKIT_API_SECRET=api_secret -p 6080:6080 openvidu-call" + exit 1 + fi + if [ -z "${LIVEKIT_API_KEY}" ]; then + echo "LIVEKIT_API_KEY is required" + echo "example: docker run -e LIVEKIT_URL=https://livekit-server:7880 -e LIVEKIT_API_KEY=api_key -e LIVEKIT_API_SECRET=api_secret -p 6080:6080 openvidu-call" + exit 1 + fi + if [ -z "${LIVEKIT_API_SECRET}" ]; then + echo "LIVEKIT_API_SECRET is required" + echo "example: docker run -e LIVEKIT_URL=https://livekit-server:7880 -e LIVEKIT_API_KEY=api_key -e LIVEKIT_API_SECRET=api_secret -p 6080:6080 openvidu-call" + exit 1 + fi fi