Create Dockerfile
Browse files- Dockerfile +45 -0
Dockerfile
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.10
|
2 |
+
|
3 |
+
# Install required packages via apt-get
|
4 |
+
RUN apt-get update && apt-get install -y \
|
5 |
+
git \
|
6 |
+
git-lfs \
|
7 |
+
ffmpeg \
|
8 |
+
libsm6 \
|
9 |
+
libxext6 \
|
10 |
+
cmake \
|
11 |
+
rsync \
|
12 |
+
libgl1-mesa-glx \
|
13 |
+
&& rm -rf /var/lib/apt/lists/* \
|
14 |
+
&& git lfs install
|
15 |
+
|
16 |
+
# Set up a user
|
17 |
+
RUN apt-get update && apt-get install -y fakeroot && \
|
18 |
+
mv /usr/bin/apt-get /usr/bin/.apt-get && \
|
19 |
+
echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && \
|
20 |
+
chmod +x /usr/bin/apt-get && \
|
21 |
+
rm -rf /var/lib/apt/lists/* && \
|
22 |
+
useradd -m -u 1000 user
|
23 |
+
|
24 |
+
# Set working directory
|
25 |
+
WORKDIR /home/user/app
|
26 |
+
|
27 |
+
# Install pip packages
|
28 |
+
RUN pip install --no-cache-dir pip==22.3.1 && \
|
29 |
+
pip install --no-cache-dir \
|
30 |
+
datasets \
|
31 |
+
huggingface-hub>=0.19 \
|
32 |
+
hf-transfer>=0.1.4 \
|
33 |
+
protobuf<4 \
|
34 |
+
click<8.1 \
|
35 |
+
pydantic~=1.0
|
36 |
+
|
37 |
+
# Install torch and other Python packages
|
38 |
+
RUN pip install torch
|
39 |
+
|
40 |
+
# Copy requirements.txt and install additional requirements
|
41 |
+
COPY --chown=1000:1000 requirements.txt /tmp/requirements.txt
|
42 |
+
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
43 |
+
|
44 |
+
# Set environment variable
|
45 |
+
ENV OPENAI_API_KEY='/content/openkey.env'
|