Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -6
Dockerfile
CHANGED
|
@@ -1,21 +1,21 @@
|
|
| 1 |
-
# 1. Use Python
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
-
# 2. Set
|
| 5 |
WORKDIR /code
|
| 6 |
|
| 7 |
-
# 3. Install
|
| 8 |
COPY ./requirements.txt /code/requirements.txt
|
| 9 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 10 |
|
| 11 |
-
# 4.
|
| 12 |
COPY . /code
|
| 13 |
|
| 14 |
-
# 5. Create
|
| 15 |
RUN useradd -m -u 1000 user
|
| 16 |
USER user
|
| 17 |
ENV HOME=/home/user \
|
| 18 |
PATH=/home/user/.local/bin:$PATH
|
| 19 |
|
| 20 |
-
# 6. Run the
|
| 21 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# 1. Use Python Image
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
+
# 2. Set Working Directory
|
| 5 |
WORKDIR /code
|
| 6 |
|
| 7 |
+
# 3. Copy Requirements & Install
|
| 8 |
COPY ./requirements.txt /code/requirements.txt
|
| 9 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 10 |
|
| 11 |
+
# 4. COPY EVERYTHING (This copies index.html, app.py, and your src/ folder)
|
| 12 |
COPY . /code
|
| 13 |
|
| 14 |
+
# 5. Create User (Hugging Face Security Requirement)
|
| 15 |
RUN useradd -m -u 1000 user
|
| 16 |
USER user
|
| 17 |
ENV HOME=/home/user \
|
| 18 |
PATH=/home/user/.local/bin:$PATH
|
| 19 |
|
| 20 |
+
# 6. Run the App using the new filename 'app.py'
|
| 21 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|