Adding all files for initial repo

This commit is contained in:
Ketan Patel committed 2025-08-01 16:06:58 -04:00
1 parent e4a9160eca
commit fc5eca2560
6 files changed
+123

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
name: Build and Push Docker Image
# This workflow is manually triggered from the "Actions" tab in GitHub.
# It requires a single input: the version tag of the flood repository to use.
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build the Docker image
id: build
run: |
docker build . -t k2patel/postfix:latest
echo "IMAGE_NAME=k2patel/postfix:latest" >> $GITHUB_ENV
- name: Push the Docker image
run: docker push ${{ env.IMAGE_NAME }}
+1
View File
@@ -0,0 +1 @@
.env
+23
View File
@@ -0,0 +1,23 @@
FROM alpine:latest
RUN apk add --no-cache bash
RUN apk add --no-cache rtorrent
RUN apk add --no-cache libcurl
RUN apk add --no-cache curl
# RUN apk add supervisor
RUN mkdir /myconfig
RUN mkdir /home/nfs_download
# Removed: COPY config/rtorrent.rc /root/.rtorrent.rc
# This file will now be mounted as a volume during container runtime.
# COPY config/rtorrent.rc /root/.rtorrent.rc
RUN chown root:root /root/.rtorrent.rc || true # Ensure this doesn't fail if file isn't there yet
COPY install/rtorrent.sh /rtorrent.sh
# COPY config/supervisord.conf /etc/supervisor/supervisord.conf
VOLUME ["/home/nfs_download"]
EXPOSE 5001/tcp
# ENTRYPOINT ["supervisord", "--nodaemon", "-c", "/etc/supervisor/supervisord.conf"]
# ENTRYPOINT ["rtorrent"]
ENTRYPOINT ["/rtorrent.sh"]
+39
View File
@@ -0,0 +1,39 @@
---
services:
rtorrent:
image: docker.io/k2patel/rtorrent:latest
container_name: rtorrent
environment:
- TZ=${TZ}
volumes:
- "${TORRENT_LOCATION}:/home/nfs_download:rw"
- "${TORRENTRC}:/root/.rtorrent.rc"
ports:
- 5001
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 5001 || exit 1"]
interval: 10s # Check every 10 seconds
timeout: 10s # Allow the command 5 seconds to complete
retries: 5 # Number of consecutive failures before marking as 'unhealthy'
start_period: 90s # Give the service 30 seconds to start up before starting health checks
floodui:
image: docker.io/k2patel/floodui:latest
container_name: floodui
environment:
- TZ=${TZ}
- FLOOD_SECRET=${FLOOD_SECRET}
- RTORRENT_SOCK=${RTORRENT_SOCK}
- RTORRENT_SCGI_HOST=${RTORRENT_SCGI_HOST}
- RTORRENT_SCGI_PORT=${RTORRENT_SCGI_PORT}
volumes:
- "${TORRENT_LOCATION}:/home/nfs_download:ro"
- "${FLOOD_LOCATION}/v4/config:/config:rw"
- "${FLOOD_LOCATION}/server/db:/server/db:rw"
ports:
- 12080:3000
restart: unless-stopped
depends_on:
rtorrent:
condition: service_healthy
+8
View File
@@ -0,0 +1,8 @@
TZ=America/New_York
FLOOD_SECRET=a98sufasidfaj
RTORRENT_SOCK=false
RTORRENT_SCGI_HOST=rtorrent
RTORRENT_SCGI_PORT=5001
TORRENT_LOCATION=/mnt/trnt
TORRENTRC=/tmp/rtorrent.rc
FLOOD_LOCATION=/tmp/flood_data
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -e
CLEANUP_FILE="/home/nfs_download/rsession/rtorrent.lock"
# Remove stale lock at startup
if [ -f "$CLEANUP_FILE" ]; then
echo "️Stale lock file found. Removing..."
rm -f "$CLEANUP_FILE"
fi
cleanup() {
echo "Caught shutdown signal. Cleaning up..."
rm -f "$CLEANUP_FILE"
echo "Cleanup complete."
}
trap cleanup INT TERM EXIT
echo "Starting rtorrent..."
exec rtorrent