circulartext commited on
Commit
ccfaf33
·
1 Parent(s): 02bf68f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -4
Dockerfile CHANGED
@@ -1,3 +1,5 @@
 
 
1
  # Use a suitable base Docker image with necessary dependencies
2
  FROM circulartextapp/readspaceout
3
 
@@ -19,11 +21,11 @@ RUN if [ -z "$USER_ID" ]; then \
19
  if id "$USER_ID" >/dev/null 2>&1; then \
20
  echo "User with ID $USER_ID already exists."; \
21
  else \
22
- adduser --uid "$USER_ID" --disabled-password --gecos '' appuser; \
23
  fi
24
 
25
  # Set appropriate permissions for the application directory
26
- RUN chown -R appuser:appuser /app && chmod -R 755 /app
27
 
28
  # Install gosu (adjust the package manager based on your base image)
29
  RUN apt-get update && apt-get install -y gosu && rm -rf /var/lib/apt/lists/*
@@ -33,10 +35,11 @@ COPY entrypoint.sh /usr/local/bin/entrypoint.sh
33
  RUN chmod +x /usr/local/bin/entrypoint.sh
34
 
35
  # Switch to the user for improved security
36
- USER appuser
37
 
38
  # Define the entrypoint script to handle user creation and application startup
39
  ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
40
 
41
  # Default command to run if the user doesn't provide a command
42
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
 
 
1
+
2
+
3
  # Use a suitable base Docker image with necessary dependencies
4
  FROM circulartextapp/readspaceout
5
 
 
21
  if id "$USER_ID" >/dev/null 2>&1; then \
22
  echo "User with ID $USER_ID already exists."; \
23
  else \
24
+ useradd -m -u "$USER_ID" user; \
25
  fi
26
 
27
  # Set appropriate permissions for the application directory
28
+ RUN chown -R user:user /app && chmod -R 755 /app
29
 
30
  # Install gosu (adjust the package manager based on your base image)
31
  RUN apt-get update && apt-get install -y gosu && rm -rf /var/lib/apt/lists/*
 
35
  RUN chmod +x /usr/local/bin/entrypoint.sh
36
 
37
  # Switch to the user for improved security
38
+ USER user
39
 
40
  # Define the entrypoint script to handle user creation and application startup
41
  ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
42
 
43
  # Default command to run if the user doesn't provide a command
44
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
45
+