circulartext commited on
Commit
ef8f6a5
·
1 Parent(s): aa82c4e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -25
Dockerfile CHANGED
@@ -1,37 +1,35 @@
1
- FROM circulartextapp/lastread
 
2
 
3
- # Define environment variables for user identification and configuration
4
- ENV USER_ID=""
5
- ENV USER_CONFIG=""
6
 
7
- # Install Hugging Face dependencies
8
- RUN pip install transformers datasets huggingface_hub
9
 
10
- # Define additional user group for the application
11
- RUN addgroup --system myappgroup
 
12
 
13
- # Add user with unique identifier and assign to the group
14
- ARG USER_ID=1000
15
- RUN adduser --system --group myappuser --uid ${USER_ID} user
16
-
17
- # Set the working directory to /app
18
- WORKDIR /app
19
 
20
  # Copy the current directory contents into the container at /app
21
- COPY . .
22
 
23
- # Set appropriate permissions for the application directory
24
- RUN chown -R user:myappgroup /app && chmod -R 775 /app
25
 
26
- # Set environment variable for user configuration file (optional)
27
- COPY user_config.json .
 
28
 
29
- # Entrypoint script to personalize the environment and run the application
30
- ENTRYPOINT ["/app/entrypoint.sh"]
31
 
32
- # Expose Hugging Face space port (e.g., 7860)
33
- EXPOSE 7860
34
 
35
- # Example CMD for Hugging Face Space application (modify as needed)
36
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
37
 
 
1
+ # Use the base Docker image
2
+ FROM circulartextapp/spaceread:latest
3
 
4
+ # Set up a new user named "user" with user ID 1000
5
+ RUN useradd -m -u 1000 user
 
6
 
7
+ # Switch to the "user" user
8
+ USER user
9
 
10
+ # Set home to the user's home directory
11
+ ENV HOME=/home/user \
12
+ PATH=/home/user/.local/bin:$PATH
13
 
14
+ # Set the working directory to the user's home directory
15
+ WORKDIR $HOME
 
 
 
 
16
 
17
  # Copy the current directory contents into the container at /app
18
+ COPY . $HOME/app
19
 
20
+ # Set permissions for the app directory
21
+ RUN chmod -R 777 $HOME/app
22
 
23
+ # Install additional dependencies if needed
24
+ # For example, if you have additional dependencies listed in requirements.txt
25
+ # RUN pip install --no-cache-dir -r $HOME/app/requirements.txt
26
 
27
+ # Switch back to the "user" user
28
+ USER user
29
 
30
+ # Set the working directory to the user's app directory
31
+ WORKDIR $HOME/app
32
 
33
+ # Example CMD (modify as needed)
34
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
35