Skip to content

Commit

Permalink
add separate version for cinesync dev
Browse files Browse the repository at this point in the history
Signed-off-by: David Young <[email protected]>
  • Loading branch information
funkypenguin committed Jan 8, 2025
1 parent 6ee0e6c commit 612ea7b
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 5 deletions.
5 changes: 1 addition & 4 deletions apps/cinesync/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ ARG VERSION
RUN apk update && apk upgrade && \
apk add --no-cache git

# RUN git clone -b CineSync-$VERSION https://github.com/sureshfizzy/CineSync.git /source

# temporary fix
RUN git clone -b anime-fix https://github.com/sureshfizzy/CineSync.git /source
RUN git clone -b CineSync-$VERSION https://github.com/sureshfizzy/CineSync.git /source

# Use an official Python runtime as a parent image
FROM python:3.11-slim
Expand Down
65 changes: 65 additions & 0 deletions apps/cinesync/dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Get upstream code
FROM alpine:latest as cloner
ARG VERSION

RUN apk update && apk upgrade && \
apk add --no-cache git

# RUN git clone -b CineSync-$VERSION https://github.com/sureshfizzy/CineSync.git /source

# temporary fix
RUN git clone -b anime-fix https://github.com/sureshfizzy/CineSync.git /source

# Use an official Python runtime as a parent image
FROM python:3.11-slim

# Set the working directory inside the container
WORKDIR /app

# Install required packages
RUN apt-get update && \
apt-get install -y inotify-tools tmux bash dialog && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Copy the requirements file and install dependencies
COPY --from=cloner /source/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# Copy the entire project to the container's working directory
COPY --from=cloner /source/MediaHub /app/MediaHub
COPY --from=cloner /source/.env ./

# Set PYTHONPATH to include the MediaHub directory
ENV PYTHONPATH=/app/MediaHub

# Set environment variables from the .env file
RUN export $(grep -v '^#' .env | xargs -d '\n' -I {} echo "ENV {}")

# fix for goss, will be overridden in chart
ENV DESTINATION_DIR=/tmp
ENV SOURCE_DIR=/tmp

# Create necessary directories
RUN mkdir -p /app/db

# Set environment variables for PUID and PGID
ENV PUID=1000
ENV PGID=1000

# Add ttyd
ADD --chmod=755 https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64 /usr/local/bin/ttyd
# add local files
COPY --chown=568:568 apps/cinesync/cinesync.sh /
COPY --chown=568:568 apps/cinesync/launch-tmux.sh /
COPY --chown=568:568 apps/cinesync/entrypoint.sh /
COPY --chown=568:568 apps/cinesync/restricted.tmux.conf /

# Force our preferred user
ARG user=elfie
RUN groupadd -g 568 $user && useradd -d /app/db --create-home --uid 568 --gid 568 --shell /bin/bash $user
RUN chown elfie /app/db
USER 568

# Run the application
ENTRYPOINT ["/entrypoint.sh"]
18 changes: 18 additions & 0 deletions apps/cinesync/dev/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#process
process:
python3:
running: true
ttyd:
running: true

# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port
port:
# https://github.com/aelsabbahy/goss/issues/149
tcp:3001:
listening: true

# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http
http:
http://localhost:3001:
status: 200
13 changes: 12 additions & 1 deletion apps/cinesync/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
"enabled": false,
"type": "web"
}
}
},
{
"name": "dev",
"platforms": [
"linux/amd64"
],
"stable": false,
"tests": {
"enabled": false,
"type": "web"
}
}
]
}

0 comments on commit 612ea7b

Please sign in to comment.