Update Dockerfile
Browse files- Dockerfile +35 -42
Dockerfile
CHANGED
|
@@ -1,51 +1,44 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
FROM
|
| 3 |
-
|
| 4 |
-
# Set
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
# Define environment variables for Jackett's configuration
|
| 12 |
-
ENV XDG_DATA_HOME="/config" \
|
| 13 |
-
XDG_CONFIG_HOME="/config" \
|
| 14 |
-
TMPDIR="/run/jackett-temp" \
|
| 15 |
-
HOME="/home/user" \
|
| 16 |
-
PATH="/home/user/.local/bin:$PATH"
|
| 17 |
-
|
| 18 |
-
# Create a user with UID 1000 to avoid permission issues
|
| 19 |
RUN useradd -m -u 1000 user
|
| 20 |
|
| 21 |
# Set the working directory to the user's home directory
|
| 22 |
WORKDIR $HOME/app
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
RUN \
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
# Ensure everything runs as root
|
| 44 |
USER root
|
| 45 |
|
| 46 |
-
#
|
| 47 |
-
|
|
|
|
| 48 |
|
| 49 |
-
#
|
| 50 |
-
VOLUME /config
|
| 51 |
EXPOSE 9117
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 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 |
+
# Switch to the "user" user for all operations moving forward
|
| 21 |
+
USER user
|
| 22 |
+
|
| 23 |
+
# Create directories for Jackett installation and downloads
|
| 24 |
+
RUN mkdir -p /opt/Jackett
|
| 25 |
+
|
| 26 |
+
# Download and extract the latest Jackett release into /opt/Jackett
|
| 27 |
+
RUN release=$(wget -q https://github.com/Jackett/Jackett/releases/latest -O - | grep "title>Release" | cut -d " " -f 4) && \
|
| 28 |
+
f=Jackett.Binaries.LinuxAMDx64.tar.gz && \
|
| 29 |
+
wget -Nc https://github.com/Jackett/Jackett/releases/download/$release/"$f" -P /opt && \
|
| 30 |
+
tar -xzf /opt/"$f" -C /opt/Jackett && \
|
| 31 |
+
rm /opt/"$f"
|
| 32 |
+
|
| 33 |
+
# Switch back to root to set up Jackett as a service
|
|
|
|
| 34 |
USER root
|
| 35 |
|
| 36 |
+
# Install Jackett as a systemd service
|
| 37 |
+
WORKDIR /opt/Jackett/Jackett*
|
| 38 |
+
RUN ./install_service_systemd.sh
|
| 39 |
|
| 40 |
+
# Expose the port used by Jackett (default is 9117)
|
|
|
|
| 41 |
EXPOSE 9117
|
| 42 |
+
|
| 43 |
+
# Set the default command to check the status of Jackett service
|
| 44 |
+
CMD ["systemctl", "status", "jackett.service"]
|