-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workflow build Docker image with arm64,amd64 (#124)
* Workflow build Docker image with arm64,amd64 Add entrypoint.sh, start with custom UserID/GroupID Rework docker-compose Rework dockerfile * Volumes provided for data Backward compatibility for old key.txt path Additional documentation provided on README.md * Dokcerfile install with pip requirements.txt * Fix key.txt permissions
- Loading branch information
Showing
6 changed files
with
201 additions
and
95 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 |
---|---|---|
@@ -1,25 +1,6 @@ | ||
**/__pycache__ | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/azds.yaml | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
README.md | ||
* | ||
!*.py | ||
!lib | ||
!plugins | ||
!requirements.txt | ||
!entrypoint.sh |
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
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 |
---|---|---|
@@ -1,15 +1,14 @@ | ||
FROM python:3.8-alpine | ||
LABEL maintainer="Thomas Gorgolione <[email protected]>" | ||
WORKDIR /app | ||
COPY . . | ||
RUN apk add --no-cache --update bash tzdata ffmpeg curl su-exec && \ | ||
apk add --no-cache --virtual builddeps gcc musl-dev python3-dev libffi-dev openssl-dev cargo && \ | ||
pip3 install -r requirements.txt --no-cache-dir && \ | ||
apk del builddeps && \ | ||
touch /app/is_container && \ | ||
mv entrypoint.sh /usr/local/bin && \ | ||
rm -rf /tmp/* $HOME/.cache $HOME/.cargo | ||
|
||
RUN apk add --no-cache --update ffmpeg | ||
COPY *.ini /app/ | ||
COPY *.py /app/ | ||
COPY cache/ /app/cache/ | ||
COPY data/ /app/data/ | ||
COPY lib/ /app/lib/ | ||
COPY plugins /app/plugins | ||
COPY plugins_ext /app/plugins_ext | ||
COPY known_stations.json /app/ | ||
RUN touch /app/is_container | ||
|
||
ENTRYPOINT ["python3", "/app/tvh_main.py"] | ||
VOLUME /app/data /app/plugins_ext /app/.cabernet | ||
EXPOSE 6077 5004 | ||
ENTRYPOINT ["entrypoint.sh"] |
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
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 |
---|---|---|
@@ -1,22 +1,17 @@ | ||
# NOTE: Cabernet tends to maintain versions on its own and will conflict with docker's | ||
# versioning system. | ||
# The recommendation is to have the entire cabernet source folder be in its own volume. | ||
# whether you mount /app or /app/cabernet, the whole cabernet folder should be a volume. | ||
# then run the python script tvh_main.py at the top level Caberent folder to start Cabernet. | ||
|
||
version: '2.4' | ||
services: | ||
cabernet: | ||
container_name: cabernet | ||
image: ghcr.io/cabernetwork/cabernet:latest | ||
environment: | ||
- TZ="America/New_York" | ||
- PUID=1000 | ||
- PGID=1000 | ||
- TZ="Etc/UTC" # Timezone (Optional) | ||
- PUID=1000 # UserID (Optional) | ||
- PGID=1000 # GroupID (Optional) | ||
ports: | ||
- "5004:5004" # Port used to stream | ||
- "6077:6077" # Web Interface Port | ||
- "5004:5004" # Port used to stream | ||
restart: unless-stopped | ||
volumes: | ||
- ./docker/cabernet/config/app:/app | ||
- ./.cabernet/key.txt:/root/.cabernet/key.txt | ||
- /path/to/cabernet/data:/app/data # App data (Optional) | ||
- /path/to/cabernet/plugins_ext:/app/plugins_ext # Plugins Data (Optional) | ||
- /path/to/cabernet/secrets:/app/.cabernet # Ecryption key data (Optional) |
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,38 @@ | ||
#!/bin/sh | ||
|
||
# Add local user | ||
# Either use the USER_ID if passed in at runtime or | ||
# fallback | ||
|
||
USER_ID=${PUID:-1000} | ||
GROUP_ID=${PGID:-1000} | ||
USERNAME=cabernet | ||
echo "Starting with UID : $USER_ID" | ||
addgroup -S -g $GROUP_ID $USERNAME | ||
adduser -S -D -H -h /app -u $USER_ID -G $USERNAME $USERNAME | ||
|
||
blockUpdate="/app/do_not_updagrade_from_WEBUI_on_Docker" | ||
|
||
oldKeyFile="/root/.cabernet/key.txt" | ||
newKeyFile="/app/.cabernet/key.txt" | ||
|
||
if [ -f "$oldKeyFile" ]; then | ||
|
||
cat <<EOF | ||
---------- | ||
!!!WARNING!!! | ||
==> DECREPTED Volume Option | ||
Please update your volume for 'key.txt' to new location. | ||
$newKeyFile | ||
---------- | ||
EOF | ||
|
||
cp "$oldKeyFile" "$newKeyFile" | ||
fi | ||
|
||
# Set permissions | ||
chown -R $USER_ID:$GROUP_ID /app | ||
|
||
[ ! -f "$blockUpdate" ] && touch "$blockUpdate" | ||
|
||
su-exec $USERNAME python3 /app/tvh_main.py "$@" |