Skip to content

Commit

Permalink
chore: add bililive-go home for docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
paomian committed Jan 2, 2024
1 parent 9803636 commit 6259ed6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM alpine

ARG tag
ENV OUTPUT_DIR="/srv/bililive" \
CONF_DIR="/etc/bililive-go" \
LOG_DIR="/opt/bililive" \

ENV WORKDIR="/opt/bililive-go"
ENV OUTPUT_DIR="${WORKDIR}/video" \
CONF_DIR="${WORKDIR}/config" \
LOG_DIR="${WORKDIR}/log" \
PORT=8080

ENV PUID=0 PGID=0 UMASK=022
Expand Down Expand Up @@ -33,6 +35,6 @@ VOLUME $OUTPUT_DIR

EXPOSE $PORT

WORKDIR /opt/bililive
WORKDIR ${WORKDIR}
ENTRYPOINT [ "sh" ]
CMD [ "/entrypoint.sh" ]
4 changes: 3 additions & 1 deletion config.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ rpc:
bind: :8080
debug: false
interval: 20
out_put_path: /srv/bililive
out_put_path: /opt/bililive-go/video
log:
out_put_folder: /opt/bililive-go/log
feature:
use_native_flv_parser: false
live_rooms:
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ services:
restart: unless-stopped
container_name: bililive-go
volumes:
- ./Videos:/srv/bililive
- ./config.docker.yml:/etc/bililive-go/config.yml
- ./Videos:/opt/bililive-go/video
- ./config.docker.yml:/opt/bililive-go/config/config.yml
ports:
- 8080:8080

Expand Down
9 changes: 5 additions & 4 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/bin/bash
#!/bin/sh

chown -R ${PUID}:${PGID} /opt/bililive/
chown -R ${PUID}:${PGID} /srv/bililive/
HOME=/opt/bililive-go

chown -R ${PUID}:${PGID} ${HOME}

umask ${UMASK}

exec su-exec ${PUID}:${PGID} /usr/bin/bililive-go -c /etc/bililive-go/config.yml
exec su-exec ${PUID}:${PGID} /usr/bin/bililive-go -c ${HOME}/config/config.yml

0 comments on commit 6259ed6

Please sign in to comment.