circulartext commited on
Commit
bee8182
·
1 Parent(s): f79e9d6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -3
Dockerfile CHANGED
@@ -11,12 +11,14 @@ COPY . /app
11
  COPY --from=circulartextapp/readspaceout /etc/passwd /etc/passwd
12
  COPY --from=circulartextapp/readspaceout /etc/group /etc/group
13
 
 
 
 
 
 
14
  # Install gosu (adjust the package manager based on your base image)
15
  RUN apt-get update && apt-get install -y gosu && rm -rf /var/lib/apt/lists/*
16
 
17
- # Set appropriate permissions for the application directory
18
- RUN chown -R user:user /app && chmod -R 755 /app
19
-
20
  # Set the entrypoint script as executable
21
  COPY entrypoint.sh /usr/local/bin/entrypoint.sh
22
  RUN chmod +x /usr/local/bin/entrypoint.sh
 
11
  COPY --from=circulartextapp/readspaceout /etc/passwd /etc/passwd
12
  COPY --from=circulartextapp/readspaceout /etc/group /etc/group
13
 
14
+ # Set appropriate permissions for the application directory using UID and GID
15
+ RUN if getent passwd user > /dev/null 2>&1 && getent group user > /dev/null 2>&1; then \
16
+ chown -R "$USER_ID":"$USER_GROUP" /app && chmod -R 755 /app; \
17
+ fi
18
+
19
  # Install gosu (adjust the package manager based on your base image)
20
  RUN apt-get update && apt-get install -y gosu && rm -rf /var/lib/apt/lists/*
21
 
 
 
 
22
  # Set the entrypoint script as executable
23
  COPY entrypoint.sh /usr/local/bin/entrypoint.sh
24
  RUN chmod +x /usr/local/bin/entrypoint.sh