Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
9d1bdfb
1
Parent(s):
bf89488
chore: Add Dockerfile for containerization
Browse files- Dockerfile +22 -0
Dockerfile
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.11
|
2 |
+
# Set up a new user named "user" with user ID 1000
|
3 |
+
RUN useradd -m -u 1000 user
|
4 |
+
|
5 |
+
# Switch to the "user" user
|
6 |
+
USER user
|
7 |
+
|
8 |
+
# Set home to the user's home directory
|
9 |
+
ENV HOME=/home/user \
|
10 |
+
PATH=/home/user/.local/bin:$PATH
|
11 |
+
|
12 |
+
# Set the working directory to the user's home directory
|
13 |
+
WORKDIR $HOME/code
|
14 |
+
WORKDIR /code
|
15 |
+
|
16 |
+
COPY ./requirements.txt /code/requirements.txt
|
17 |
+
|
18 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
19 |
+
|
20 |
+
COPY . .
|
21 |
+
|
22 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--log-config=log_conf.yaml"]
|