Spaces:
Sleeping
Sleeping
Ezhil
commited on
Commit
Β·
76647ec
1
Parent(s):
45ce216
backend deployment
Browse files- Dockerfile +9 -13
- README.md +6 -5
Dockerfile
CHANGED
|
@@ -1,24 +1,20 @@
|
|
| 1 |
-
|
| 2 |
-
FROM python:3.9
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
USER user
|
| 7 |
-
|
| 8 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
| 9 |
-
|
| 10 |
-
# Set the working directory in the container
|
| 11 |
WORKDIR /app
|
| 12 |
|
| 13 |
-
|
|
|
|
| 14 |
|
| 15 |
# Install dependencies
|
| 16 |
-
RUN pip install --
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
|
|
|
| 21 |
|
|
|
|
| 22 |
# Run FastAPI and Streamlit in parallel
|
| 23 |
CMD ["uvicorn" ,"api.main:app","--host" ,"0.0.0.0", "--port", "7860"]
|
| 24 |
|
|
|
|
| 1 |
+
FROM python:3.11
|
|
|
|
| 2 |
|
| 3 |
+
# Set the working directory inside the container
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# Copy all project files into the container
|
| 7 |
+
COPY . /app
|
| 8 |
|
| 9 |
# Install dependencies
|
| 10 |
+
RUN pip install --upgrade pip
|
| 11 |
|
| 12 |
+
RUN mkdir -p /app/logs && chmod -R 777 /app/logs
|
| 13 |
|
| 14 |
+
# Install any needed packages specified in requirements.txt
|
| 15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
+
EXPOSE 7860
|
| 18 |
# Run FastAPI and Streamlit in parallel
|
| 19 |
CMD ["uvicorn" ,"api.main:app","--host" ,"0.0.0.0", "--port", "7860"]
|
| 20 |
|
README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: docker
|
| 7 |
-
app_file: Dockerfile
|
| 8 |
pinned: false
|
| 9 |
---
|
| 10 |
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: World Population FastAPI
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: gray
|
| 6 |
sdk: docker
|
|
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
| 11 |
+
|