diff --git a/Config/F-DroidRepo/Dockerfile b/Config/F-DroidRepo/Dockerfile index 1134423..1d1a056 100644 --- a/Config/F-DroidRepo/Dockerfile +++ b/Config/F-DroidRepo/Dockerfile @@ -1,4 +1,5 @@ # Build a container which hosts Android apps through an F-Droid repository. +# https://f-droid.org/en/docs/Setup_an_F-Droid_App_Repo/ # Base Image # @@ -6,12 +7,32 @@ FROM debian:trixie-slim # Setup # -RUN mkdir -pv "$REPO/" +ARG REPO +ENV REPO="$REPO" +ARG WEBROOT +ENV WEBROOT="$WEBROOT" + +USER root +RUN mkdir -pv "$REPO" +WORKDIR "$REPO" # Install Packages# +# https://f-droid.org/en/docs/Installing_the_Server_and_Repo_Tools/#debianubuntumintetc -# TBD/TODO: get list of packages -RUN apt-get update && apt-get install bash curl fdroidserver +RUN apt-get update && apt-get install sudo bash curl git vim nginx +COPY files/debian-backports.sources /etc/apt/sources.list.d/ +RUN apt-get update && apt-get install -t trixie-backports fdroidserver + +# Generate F-Droid Repo # + + +# Publish? # + +#TBD/TODO + +# Configure F-Droid Repo # + +RUN sed -i 's/TBD/TODO/g' TBD.cfg # Download Files # @@ -39,11 +60,15 @@ RUN bash -c 'if [[ -n "$FILE17" ]]; then curl "$FILE17" "$REPO"/; fi' RUN bash -c 'if [[ -n "$FILE18" ]]; then curl "$FILE18" "$REPO"/; fi' RUN bash -c 'if [[ -n "$FILE19" ]]; then curl "$FILE19" "$REPO"/; fi' +RUN bash -c 'cd "$REPO" && fdroid update' + +# Publish Repo to Web Root # + +#TBD/TODO + # Start Container # -USER root -WORKDIR "$REPO" -CMD cd "$REPO" && \ - fdroid update \ - && tail -F /var/mail/mail & \ - && wait -n +CMD sleep 5 \ + && tail -F /var/mail/* & \ + && tail -F /var/log/nginx/* & \ + && wait -n diff --git a/Config/F-DroidRepo/docker-compose.example.yml b/Config/F-DroidRepo/docker-compose.example.yml index 33c7957..074db9c 100644 --- a/Config/F-DroidRepo/docker-compose.example.yml +++ b/Config/F-DroidRepo/docker-compose.example.yml @@ -8,9 +8,13 @@ services: build: context: ./ network: host + args: + WEBROOT: ${WEBROOT} + REPO: ${REPO} restart: always environment: - - REPO=$REPO + - WEBROOT=/var/www/html + - REPO=/root/fdroid - FILE0=$FILE0 - FILE1=$FILE1 - FILE2=$FILE2 @@ -32,7 +36,8 @@ services: - FILE18=$FILE18 - FILE19=$FILE19 volumes: - - ../../Volumes/F-DroidRepo:$REPO + - ../../Volumes/F-DroidRepo/fdroid:/root/fdroid + - ../../Volumes/F-DroidRepo/nginx:/var/www/html deploy: mode: global resources: diff --git a/Config/F-DroidRepo/files/debian-backports.sources b/Config/F-DroidRepo/files/debian-backports.sources new file mode 100644 index 0000000..dbb5e46 --- /dev/null +++ b/Config/F-DroidRepo/files/debian-backports.sources @@ -0,0 +1,6 @@ +Types: deb deb-src +URIs: http://deb.debian.org/debian +Suites: trixie-backports +Components: main contrib non-free non-free-firmware +Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg +Enabled: yes