Spaces:
Paused
Paused
Create Dockerfile
Browse files- Dockerfile +43 -0
Dockerfile
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official Ubuntu image as a base
|
| 2 |
+
FROM ubuntu:22.04
|
| 3 |
+
|
| 4 |
+
# Set environment variables
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive \
|
| 6 |
+
HOME=/home/user \
|
| 7 |
+
PATH=/home/user/.local/bin:$PATH
|
| 8 |
+
|
| 9 |
+
# Create a new user named "user" with user ID 1000 to avoid permission issues
|
| 10 |
+
RUN useradd -m -u 1000 user
|
| 11 |
+
|
| 12 |
+
# Set the working directory to the user's home directory
|
| 13 |
+
WORKDIR $HOME/app
|
| 14 |
+
|
| 15 |
+
# Update and install dependencies (run as root)
|
| 16 |
+
RUN apt-get update && \
|
| 17 |
+
apt-get install -y wget curl libicu-dev libcurl4-openssl-dev tar && \
|
| 18 |
+
rm -rf /var/lib/apt/lists/*
|
| 19 |
+
|
| 20 |
+
# Create directories for Jackett installation (run as root)
|
| 21 |
+
RUN mkdir -p /opt/Jackett
|
| 22 |
+
|
| 23 |
+
# Download and extract the latest Jackett release into /opt/Jackett (run as root)
|
| 24 |
+
RUN release=$(wget -q https://github.com/Jackett/Jackett/releases/latest -O - | grep "title>Release" | cut -d " " -f 4) && \
|
| 25 |
+
f=Jackett.Binaries.LinuxAMDx64.tar.gz && \
|
| 26 |
+
wget -Nc https://github.com/Jackett/Jackett/releases/download/$release/"$f" -P /opt && \
|
| 27 |
+
tar -xzf /opt/"$f" -C /opt/Jackett && \
|
| 28 |
+
rm /opt/"$f"
|
| 29 |
+
|
| 30 |
+
# Switch to root to change the ownership of the Jackett directory
|
| 31 |
+
USER root
|
| 32 |
+
|
| 33 |
+
# Change the owner of /opt/Jackett/Jackett to user (ID 1000)
|
| 34 |
+
RUN chown -R user:user /opt/Jackett
|
| 35 |
+
|
| 36 |
+
# Switch to the user to run Jackett
|
| 37 |
+
USER user
|
| 38 |
+
|
| 39 |
+
# Expose the port used by Jackett (default is 9117)
|
| 40 |
+
EXPOSE 9117
|
| 41 |
+
|
| 42 |
+
# Set the default command to run Jackett manually without auto-update
|
| 43 |
+
CMD ["/opt/Jackett/Jackett/jackett", "--NoUpdate"]
|