File size: 1,145 Bytes
1bacad4
 
 
442f97c
1bacad4
 
46270d0
 
 
 
 
 
 
 
 
 
442f97c
46270d0
1bacad4
442f97c
46270d0
1bacad4
442f97c
 
1bacad4
46270d0
 
 
1779f92
 
 
46270d0
442f97c
 
1bacad4
78bd78c
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
# read the doc: https://huggingface.co./docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile

# Use an official Python runtime as a parent image
FROM python:3.9

# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user

# Switch to the "user" user
USER user

# Set home to the user's home directory
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# Set the working directory in the container to /app
WORKDIR $HOME/app

# Add the current directory contents into the container at /app
ADD . $HOME/app

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app

# # Expose the secret NOMIC_API_KEY at buildtime and use its value
# RUN --mount=type=secret,id=NOMIC_API_KEY,mode=0444,required=true \
#     nomic login $(cat /run/secrets/NOMIC_API_KEY)

# Make port 7860 available to the world outside this container
EXPOSE 7860

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]