ariansyahdedy commited on
Commit
744ad58
·
1 Parent(s): 26236e1
.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 pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
10
 
11
- COPY ./app /code/app
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
- COPY --chown=user . $HOME/app
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)