Spaces:
Sleeping
Sleeping
vkrishnan569
commited on
Commit
•
630946f
1
Parent(s):
a749c69
Server Deployment
Browse files- Dockerfile +4 -15
Dockerfile
CHANGED
@@ -1,24 +1,13 @@
|
|
1 |
-
# Use Python 3.9 as the base image
|
2 |
FROM python:3.9
|
3 |
|
4 |
-
# Create a new user with UID 1000 and a home directory
|
5 |
-
RUN useradd -m -u 1000 user
|
6 |
-
|
7 |
-
# Set the new user as the default user for the container
|
8 |
-
USER user
|
9 |
-
|
10 |
-
# Set the working directory to /code
|
11 |
WORKDIR /code
|
12 |
|
13 |
-
# Copy requirements.txt and install dependencies
|
14 |
COPY ./requirements.txt /code/requirements.txt
|
|
|
15 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
16 |
|
17 |
-
|
18 |
-
RUN chown -R user:user /code
|
19 |
|
20 |
-
|
21 |
-
COPY --chown=user:user . /code
|
22 |
|
23 |
-
|
24 |
-
CMD ["gunicorn", "-b", "0.0.0.0:7860", "main:app"]
|
|
|
|
|
1 |
FROM python:3.9
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
WORKDIR /code
|
4 |
|
|
|
5 |
COPY ./requirements.txt /code/requirements.txt
|
6 |
+
|
7 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
|
9 |
+
COPY . .
|
|
|
10 |
|
11 |
+
RUN mkdir -p /path_to_cache_directory
|
|
|
12 |
|
13 |
+
CMD ["uvicorn","main:model","--host", "0.0.0.0", "--port", "80"]
|
|