Spaces:
Sleeping
Sleeping
saicharan1234
commited on
Commit
•
3a0658b
1
Parent(s):
74cdd70
Update Dockerfile
Browse files- Dockerfile +15 -5
Dockerfile
CHANGED
@@ -1,23 +1,33 @@
|
|
1 |
FROM python:3.10.12
|
2 |
|
|
|
3 |
WORKDIR /code
|
4 |
|
|
|
5 |
COPY ./requirements.txt /code/requirements.txt
|
6 |
-
|
7 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
-
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
|
9 |
|
|
|
|
|
|
|
|
|
|
|
10 |
|
|
|
11 |
RUN useradd -m -u 1000 user
|
12 |
|
|
|
13 |
USER user
|
14 |
|
|
|
15 |
ENV HOME=/home/user \
|
16 |
-
|
17 |
|
|
|
18 |
WORKDIR $HOME/app
|
19 |
|
|
|
20 |
COPY --chown=user . $HOME/app
|
21 |
|
22 |
-
|
23 |
-
CMD ["python", "main.py"]
|
|
|
1 |
FROM python:3.10.12
|
2 |
|
3 |
+
# Set the working directory
|
4 |
WORKDIR /code
|
5 |
|
6 |
+
# Copy and install requirements
|
7 |
COPY ./requirements.txt /code/requirements.txt
|
|
|
8 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
|
9 |
|
10 |
+
# Install additional system packages
|
11 |
+
RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git
|
12 |
+
|
13 |
+
# Clone the repository and copy its contents to /data
|
14 |
+
RUN git clone https://huggingface.co/Vision-CAIR/vicuna-7b /data
|
15 |
|
16 |
+
# Add a new user
|
17 |
RUN useradd -m -u 1000 user
|
18 |
|
19 |
+
# Switch to the new user
|
20 |
USER user
|
21 |
|
22 |
+
# Set environment variables
|
23 |
ENV HOME=/home/user \
|
24 |
+
PATH=/home/user/.local/bin:$PATH
|
25 |
|
26 |
+
# Create application directory and set as working directory
|
27 |
WORKDIR $HOME/app
|
28 |
|
29 |
+
# Copy application code and set ownership
|
30 |
COPY --chown=user . $HOME/app
|
31 |
|
32 |
+
# Set the command to run the application
|
33 |
+
CMD ["python", "main.py"]
|