Spaces:
Runtime error
Runtime error
Ubuntu
commited on
Commit
·
aa67d46
1
Parent(s):
6715b33
- .ipynb_checkpoints/Dockerfile-checkpoint +37 -7
- Dockerfile +37 -7
- requirements.txt +1 -0
.ipynb_checkpoints/Dockerfile-checkpoint
CHANGED
|
@@ -1,6 +1,36 @@
|
|
| 1 |
|
|
|
|
| 2 |
FROM python:3.9
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# WORKDIR /code
|
| 5 |
|
| 6 |
|
|
@@ -12,16 +42,16 @@ FROM python:3.9
|
|
| 12 |
|
| 13 |
# RUN useradd -m -u 1000 user
|
| 14 |
|
| 15 |
-
WORKDIR /home/user/app
|
| 16 |
-
COPY ./requirements.txt /home/user/app/requirements.txt
|
| 17 |
-
RUN pip install --no-cache-dir --upgrade -r /home/user/app/requirements.txt
|
| 18 |
-
# RUN --mount=target=requirements.txt,source=requirements.txt pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
-
# RUN --mount=target=/root/packages.txt,source=packages.txt sed -i 's http://deb.debian.org http://cdn-aws.deb.debian.org g' /etc/apt/sources.list && sed -i 's http://archive.ubuntu.com http://us-east-1.ec2.archive.ubuntu.com g' /etc/apt/sources.list && sed -i '/security/d' /etc/apt/sources.list && apt-get update && xargs -r -a /root/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
|
| 21 |
|
| 22 |
-
COPY --link --chown=1000 --from=lfs /app /home/user/app
|
| 23 |
|
| 24 |
-
COPY --link --chown=1000 ./ /home/user/app
|
| 25 |
|
| 26 |
|
| 27 |
|
|
|
|
| 1 |
|
| 2 |
+
# Use the official Python 3.9 image
|
| 3 |
FROM python:3.9
|
| 4 |
|
| 5 |
+
# Set the working directory to /code
|
| 6 |
+
WORKDIR /code
|
| 7 |
+
|
| 8 |
+
# Copy the current directory contents into the container at /code
|
| 9 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 10 |
+
|
| 11 |
+
# Install requirements.txt
|
| 12 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 13 |
+
|
| 14 |
+
# Set up a new user named "user" with user ID 1000
|
| 15 |
+
# RUN useradd -m -u 1000 user
|
| 16 |
+
# # Switch to the "user" user
|
| 17 |
+
# USER user
|
| 18 |
+
# # Set home to the user's home directory
|
| 19 |
+
# ENV HOME=/home/user \\
|
| 20 |
+
# PATH=/home/user/.local/bin:$PATH
|
| 21 |
+
|
| 22 |
+
# # Set the working directory to the user's home directory
|
| 23 |
+
# WORKDIR $HOME/app
|
| 24 |
+
|
| 25 |
+
# # Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 26 |
+
# COPY --chown=user . $HOME/app
|
| 27 |
+
|
| 28 |
+
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
| 29 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
# WORKDIR /code
|
| 35 |
|
| 36 |
|
|
|
|
| 42 |
|
| 43 |
# RUN useradd -m -u 1000 user
|
| 44 |
|
| 45 |
+
# WORKDIR /home/user/app
|
| 46 |
+
# COPY ./requirements.txt /home/user/app/requirements.txt
|
| 47 |
+
# RUN pip install --no-cache-dir --upgrade -r /home/user/app/requirements.txt
|
| 48 |
+
# # RUN --mount=target=requirements.txt,source=requirements.txt pip install --no-cache-dir -r requirements.txt
|
| 49 |
|
| 50 |
+
# # RUN --mount=target=/root/packages.txt,source=packages.txt sed -i 's http://deb.debian.org http://cdn-aws.deb.debian.org g' /etc/apt/sources.list && sed -i 's http://archive.ubuntu.com http://us-east-1.ec2.archive.ubuntu.com g' /etc/apt/sources.list && sed -i '/security/d' /etc/apt/sources.list && apt-get update && xargs -r -a /root/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
|
| 51 |
|
| 52 |
+
# COPY --link --chown=1000 --from=lfs /app /home/user/app
|
| 53 |
|
| 54 |
+
# COPY --link --chown=1000 ./ /home/user/app
|
| 55 |
|
| 56 |
|
| 57 |
|
Dockerfile
CHANGED
|
@@ -1,6 +1,36 @@
|
|
| 1 |
|
|
|
|
| 2 |
FROM python:3.9
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# WORKDIR /code
|
| 5 |
|
| 6 |
|
|
@@ -12,16 +42,16 @@ FROM python:3.9
|
|
| 12 |
|
| 13 |
# RUN useradd -m -u 1000 user
|
| 14 |
|
| 15 |
-
WORKDIR /home/user/app
|
| 16 |
-
COPY ./requirements.txt /home/user/app/requirements.txt
|
| 17 |
-
RUN pip install --no-cache-dir --upgrade -r /home/user/app/requirements.txt
|
| 18 |
-
# RUN --mount=target=requirements.txt,source=requirements.txt pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
-
# RUN --mount=target=/root/packages.txt,source=packages.txt sed -i 's http://deb.debian.org http://cdn-aws.deb.debian.org g' /etc/apt/sources.list && sed -i 's http://archive.ubuntu.com http://us-east-1.ec2.archive.ubuntu.com g' /etc/apt/sources.list && sed -i '/security/d' /etc/apt/sources.list && apt-get update && xargs -r -a /root/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
|
| 21 |
|
| 22 |
-
COPY --link --chown=1000 --from=lfs /app /home/user/app
|
| 23 |
|
| 24 |
-
COPY --link --chown=1000 ./ /home/user/app
|
| 25 |
|
| 26 |
|
| 27 |
|
|
|
|
| 1 |
|
| 2 |
+
# Use the official Python 3.9 image
|
| 3 |
FROM python:3.9
|
| 4 |
|
| 5 |
+
# Set the working directory to /code
|
| 6 |
+
WORKDIR /code
|
| 7 |
+
|
| 8 |
+
# Copy the current directory contents into the container at /code
|
| 9 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 10 |
+
|
| 11 |
+
# Install requirements.txt
|
| 12 |
+
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 13 |
+
|
| 14 |
+
# Set up a new user named "user" with user ID 1000
|
| 15 |
+
# RUN useradd -m -u 1000 user
|
| 16 |
+
# # Switch to the "user" user
|
| 17 |
+
# USER user
|
| 18 |
+
# # Set home to the user's home directory
|
| 19 |
+
# ENV HOME=/home/user \\
|
| 20 |
+
# PATH=/home/user/.local/bin:$PATH
|
| 21 |
+
|
| 22 |
+
# # Set the working directory to the user's home directory
|
| 23 |
+
# WORKDIR $HOME/app
|
| 24 |
+
|
| 25 |
+
# # Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 26 |
+
# COPY --chown=user . $HOME/app
|
| 27 |
+
|
| 28 |
+
# Start the FastAPI app on port 7860, the default port expected by Spaces
|
| 29 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
|
| 34 |
# WORKDIR /code
|
| 35 |
|
| 36 |
|
|
|
|
| 42 |
|
| 43 |
# RUN useradd -m -u 1000 user
|
| 44 |
|
| 45 |
+
# WORKDIR /home/user/app
|
| 46 |
+
# COPY ./requirements.txt /home/user/app/requirements.txt
|
| 47 |
+
# RUN pip install --no-cache-dir --upgrade -r /home/user/app/requirements.txt
|
| 48 |
+
# # RUN --mount=target=requirements.txt,source=requirements.txt pip install --no-cache-dir -r requirements.txt
|
| 49 |
|
| 50 |
+
# # RUN --mount=target=/root/packages.txt,source=packages.txt sed -i 's http://deb.debian.org http://cdn-aws.deb.debian.org g' /etc/apt/sources.list && sed -i 's http://archive.ubuntu.com http://us-east-1.ec2.archive.ubuntu.com g' /etc/apt/sources.list && sed -i '/security/d' /etc/apt/sources.list && apt-get update && xargs -r -a /root/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
|
| 51 |
|
| 52 |
+
# COPY --link --chown=1000 --from=lfs /app /home/user/app
|
| 53 |
|
| 54 |
+
# COPY --link --chown=1000 ./ /home/user/app
|
| 55 |
|
| 56 |
|
| 57 |
|
requirements.txt
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
opencv-python
|
| 2 |
encoded-video
|
| 3 |
torch
|
|
|
|
| 1 |
+
gradio
|
| 2 |
opencv-python
|
| 3 |
encoded-video
|
| 4 |
torch
|