File size: 1,105 Bytes
ed9b501
3658992
ed9b501
 
 
c0e77ac
ed9b501
 
c0e77ac
ed9b501
 
934aa4a
ed9b501
 
 
1130934
ed9b501
 
1130934
ed9b501
 
8d7f247
ed9b501
 
8d7f247
ed9b501
 
649c393
ed9b501
 
23aa172
ed9b501
 
649c393
ed9b501
28175d8
0c91ad6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM circulartextapp/lastread

# Define environment variables for user identification and configuration
ENV USER_ID=""
ENV USER_CONFIG=""

# Install Hugging Face dependencies
RUN pip install transformers datasets huggingface_hub

# Define additional user group for the application
RUN addgroup --system myappgroup

# Add user with unique identifier and assign to the group
ARG USER_ID=1000
RUN adduser --system --group myappuser --uid ${USER_ID} user

# Set the working directory to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . .

# Set appropriate permissions for the application directory
RUN chown -R user:myappgroup /app && chmod -R 775 /app

# Set environment variable for user configuration file (optional)
COPY user_config.json .

# Entrypoint script to personalize the environment and run the application
ENTRYPOINT ["/app/entrypoint.sh"]

# Expose Hugging Face space port (e.g., 7860)
EXPOSE 7860

# Example CMD for Hugging Face Space application (modify as needed)
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]