diff --git a/Dockerfile b/Dockerfile index a9d95c7..b15251c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,13 +19,17 @@ RUN git clone https://github.com/deepch/RTSPtoWeb.git && cd RTSPtoWeb && git che # Move to /dist directory as the place for resulting binary folder WORKDIR /dist +COPY config/config.json /dist/ +COPY start.sh / + # Copy binary from build to main folder RUN cp /build/RTSPtoWeb/RTSPtoWeb . RUN cp -r /build/RTSPtoWeb/web . +RUN chmod a+x /dist/RTSPtoWeb # Export necessary port & volume EXPOSE 8083 -VOLUME ["/config"] +VOLUME /config # Command to run when starting the container -CMD "/dist/RTSPtoWeb -config /config/config.json" \ No newline at end of file +ENTRYPOINT "/start.sh" \ No newline at end of file diff --git a/data/config.json b/config/config.json similarity index 100% rename from data/config.json rename to config/config.json diff --git a/docker-compose.yml b/docker-compose.yml index 8eb7845..de19561 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: rtsp-to-web: image: cmer/rtsp-to-web volumes: - - ./data/config:/config + - ./config:/config ports: - 8083:8083 - restart: unless-stopped \ No newline at end of file + restart: unless-stopped diff --git a/start.sh b/start.sh new file mode 100755 index 0000000..3604a84 --- /dev/null +++ b/start.sh @@ -0,0 +1,4 @@ +#!/bin/sh +cp /config/config.json /dist/ +cd /dist +./RTSPtoWeb \ No newline at end of file