Mythus commited on
Commit
6b4325d
·
verified ·
1 Parent(s): d0381ae

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -13
Dockerfile CHANGED
@@ -14,22 +14,37 @@ ENV XDG_DATA_HOME="/config" \
14
  XDG_CONFIG_HOME="/config" \
15
  TMPDIR=/run/jackett-temp
16
 
17
- # Use root for all operations
 
 
 
 
 
 
 
 
 
 
18
  USER root
19
 
20
- # Install necessary packages and Jackett
21
  RUN \
22
  echo "**** install packages ****" && \
23
  apk --no-cache add \
24
  icu-data-full \
25
  icu-libs && \
26
  echo "**** install jackett ****" && \
27
- mkdir -p /app/Jackett && \
 
28
  if [ -z ${JACKETT_RELEASE+x} ]; then \
29
- JACKETT_RELEASE=$(curl -sX GET "https://api.github.com/repos/Jackett/Jackett/releases/latest" | jq -r .tag_name); \
 
30
  fi && \
31
- curl -o /tmp/jacket.tar.gz -L "https://github.com/Jackett/Jackett/releases/download/${JACKETT_RELEASE}/Jackett.Binaries.LinuxMuslAMDx64.tar.gz" && \
32
- tar xf /tmp/jacket.tar.gz -C /app/Jackett --strip-components=1 && \
 
 
 
 
33
  echo "**** fix for host id mapping error ****" && \
34
  chown -R root:root /app/Jackett && \
35
  echo "**** save docker image version ****" && \
@@ -38,14 +53,13 @@ RUN \
38
  echo "**** cleanup ****" && \
39
  rm -rf /tmp/*
40
 
41
- # Create /root directory (if needed)
 
 
 
42
  RUN mkdir -p /root
43
 
44
- # Expose the necessary ports and volumes
45
  VOLUME /config
46
- EXPOSE 9117
47
-
48
- # Copy local files to the image
49
- COPY root/ /
50
 
51
- # Set the entrypoint or command (if applicable)
 
14
  XDG_CONFIG_HOME="/config" \
15
  TMPDIR=/run/jackett-temp
16
 
17
+ # Create a user with UID 1000 to avoid permission issues
18
+ RUN useradd -m -u 1000 user
19
+
20
+ # Set home to the user's home directory
21
+ ENV HOME=/home/user \
22
+ PATH=/home/user/.local/bin:$PATH
23
+
24
+ # Set the working directory to the user's home directory
25
+ WORKDIR $HOME/app
26
+
27
+ # Install packages as root
28
  USER root
29
 
 
30
  RUN \
31
  echo "**** install packages ****" && \
32
  apk --no-cache add \
33
  icu-data-full \
34
  icu-libs && \
35
  echo "**** install jackett ****" && \
36
+ mkdir -p \
37
+ /app/Jackett && \
38
  if [ -z ${JACKETT_RELEASE+x} ]; then \
39
+ JACKETT_RELEASE=$(curl -sX GET "https://api.github.com/repos/Jackett/Jackett/releases/latest" \
40
+ | jq -r .tag_name); \
41
  fi && \
42
+ curl -o \
43
+ /tmp/jacket.tar.gz -L \
44
+ "https://github.com/Jackett/Jackett/releases/download/${JACKETT_RELEASE}/Jackett.Binaries.LinuxMuslAMDx64.tar.gz" && \
45
+ tar xf \
46
+ /tmp/jacket.tar.gz -C \
47
+ /app/Jackett --strip-components=1 && \
48
  echo "**** fix for host id mapping error ****" && \
49
  chown -R root:root /app/Jackett && \
50
  echo "**** save docker image version ****" && \
 
53
  echo "**** cleanup ****" && \
54
  rm -rf /tmp/*
55
 
56
+ # Switch back to the non-root user for further actions
57
+ USER user
58
+
59
+ # Create the /root directory within the container (for use by the application, if needed)
60
  RUN mkdir -p /root
61
 
62
+ # Ports and volumes
63
  VOLUME /config
 
 
 
 
64
 
65
+ EXPOSE 9117