Spaces:
Sleeping
Sleeping
Commit ·
744ad58
1
Parent(s): 26236e1
snapshot
Browse files- .gitignore +3 -0
- Dockerfile +9 -11
- __pycache__/main.cpython-310.pyc +0 -0
- __pycache__/video.cpython-310.pyc +0 -0
- app/__pycache__/main.cpython-310.pyc +0 -0
.gitignore
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.venv
|
| 2 |
+
*.txt
|
| 3 |
+
|
Dockerfile
CHANGED
|
@@ -1,26 +1,24 @@
|
|
| 1 |
FROM python:3.10
|
| 2 |
|
|
|
|
|
|
|
| 3 |
WORKDIR /code
|
| 4 |
# Install libgl1-mesa-glx
|
| 5 |
RUN apt-get update && apt-get install -y libgl1-mesa-glx
|
| 6 |
|
| 7 |
COPY ./requirements.txt /code/requirements.txt
|
| 8 |
|
| 9 |
-
RUN
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
COPY .
|
| 12 |
|
| 13 |
# Create necessary directories and set permissions before switching to non-root user
|
| 14 |
-
RUN mkdir -p /app/uploaded_videos /app/output_frames \
|
| 15 |
&& chown -R 1000:1000 /app /code
|
| 16 |
|
| 17 |
-
RUN useradd -m -u 1000 user
|
| 18 |
-
USER user
|
| 19 |
-
ENV HOME=/home/user \
|
| 20 |
-
PATH=/home/user/.local/bin:$PATH
|
| 21 |
-
|
| 22 |
-
WORKDIR $HOME/app
|
| 23 |
|
| 24 |
-
|
| 25 |
|
| 26 |
-
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
FROM python:3.10
|
| 2 |
|
| 3 |
+
RUN useradd -m -u 1000 user
|
| 4 |
+
|
| 5 |
WORKDIR /code
|
| 6 |
# Install libgl1-mesa-glx
|
| 7 |
RUN apt-get update && apt-get install -y libgl1-mesa-glx
|
| 8 |
|
| 9 |
COPY ./requirements.txt /code/requirements.txt
|
| 10 |
|
| 11 |
+
RUN python -m venv /code/venv
|
| 12 |
+
|
| 13 |
+
RUN /code/venv/bin/pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 14 |
|
| 15 |
+
COPY --chown=user . /code
|
| 16 |
|
| 17 |
# Create necessary directories and set permissions before switching to non-root user
|
| 18 |
+
RUN mkdir -p /code/app/uploaded_videos code/app/output_frames \
|
| 19 |
&& chown -R 1000:1000 /app /code
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
ENV PATH="/code/venv/bin:$PATH"
|
| 23 |
|
| 24 |
+
CMD ["uvicorn", "code.app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
__pycache__/main.cpython-310.pyc
DELETED
|
Binary file (744 Bytes)
|
|
|
__pycache__/video.cpython-310.pyc
DELETED
|
Binary file (3.37 kB)
|
|
|
app/__pycache__/main.cpython-310.pyc
DELETED
|
Binary file (773 Bytes)
|
|
|