not-lain commited on
Commit
38ec749
1 Parent(s): 693f296

add packages

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -32
Dockerfile CHANGED
@@ -1,61 +1,67 @@
1
- FROM python:3.9
2
 
3
 
4
- RUN apt-get update && apt-get install -y fakeroot && mv /usr/bin/apt-get /usr/bin/.apt-get && echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && chmod +x /usr/bin/apt-get && rm -rf /var/lib/apt/lists/* && useradd -m -u 1000 user
5
 
6
- RUN pip install --no-cache-dir pip==22.3.1 && pip install --no-cache-dir datasets "huggingface-hub>=0.19" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0"
7
 
8
- RUN --mount=target=/tmp/packages.txt,source=packages.txt apt-get update && xargs -r -a /tmp/packages.txt apt-get install -y && apt-get install -y curl && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* && apt-get clean
9
 
10
- RUN ln -s /usr/lib/python3/dist-packages/uno.py /usr/local/lib/python3.10/site-packages/
11
- RUN ln -s /usr/lib/python3/dist-packages/unohelper.py /usr/local/lib/python3.10/site-packages/
12
 
13
- RUN apt-get update && apt-get install -y git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx && rm -rf /var/lib/apt/lists/* && git lfs install
14
 
15
 
16
- COPY --chown=1000:1000 --from=root / /
17
 
18
- WORKDIR /home/user/app
19
 
20
- RUN --mount=target=/tmp/requirements.txt,source=requirements.txt pip install --no-cache-dir -r /tmp/requirements.txt
21
 
22
 
23
 
24
- RUN pip freeze > /tmp/freeze.txt
25
 
26
- RUN pip install --no-cache-dir gradio[oauth]==5.4.0 "uvicorn>=0.14.0" spaces
27
 
28
 
29
- COPY --link --chown=1000 ./ /home/user/app
30
 
31
- COPY --from=pipfreeze --link --chown=1000 /tmp/freeze.txt /tmp/freeze.txt
32
 
33
- CMD ["python", "app.py"]
34
 
35
 
36
- # FROM python:3.9
 
 
 
 
37
 
38
- # WORKDIR /code
 
 
 
39
 
40
- # COPY ./requirements.txt /code/requirements.txt
41
 
42
- # RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
43
 
44
- # # Set up a new user named "user" with user ID 1000
45
- # RUN useradd -m -u 1000 user
46
- # # Switch to the "user" user
47
- # USER user
48
- # # Set home to the user's home directory
49
- # ENV HOME=/home/user \
50
- # PATH=/home/user/.local/bin:$PATH
51
 
52
- # # Set the working directory to the user's home directory
53
- # WORKDIR $HOME/app
54
 
55
- # # Copy the current directory contents into the container at $HOME/app setting the owner to the user
56
- # COPY --chown=user . $HOME/app
57
 
58
 
59
 
60
- # #COPY . .
61
- # CMD ["python","app.py"]
 
1
+ # FROM python:3.9
2
 
3
 
4
+ # RUN apt-get update && apt-get install -y fakeroot && mv /usr/bin/apt-get /usr/bin/.apt-get && echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && chmod +x /usr/bin/apt-get && rm -rf /var/lib/apt/lists/* && useradd -m -u 1000 user
5
 
6
+ # RUN pip install --no-cache-dir pip==22.3.1 && pip install --no-cache-dir datasets "huggingface-hub>=0.19" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0"
7
 
8
+ # RUN --mount=target=/tmp/packages.txt,source=packages.txt apt-get update && xargs -r -a /tmp/packages.txt apt-get install -y && apt-get install -y curl && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* && apt-get clean
9
 
10
+ # RUN ln -s /usr/lib/python3/dist-packages/uno.py /usr/local/lib/python3.10/site-packages/
11
+ # RUN ln -s /usr/lib/python3/dist-packages/unohelper.py /usr/local/lib/python3.10/site-packages/
12
 
13
+ # RUN apt-get update && apt-get install -y git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx && rm -rf /var/lib/apt/lists/* && git lfs install
14
 
15
 
16
+ # COPY --chown=1000:1000 --from=root / /
17
 
18
+ # WORKDIR /home/user/app
19
 
20
+ # RUN --mount=target=/tmp/requirements.txt,source=requirements.txt pip install --no-cache-dir -r /tmp/requirements.txt
21
 
22
 
23
 
24
+ # RUN pip freeze > /tmp/freeze.txt
25
 
26
+ # RUN pip install --no-cache-dir gradio[oauth]==5.4.0 "uvicorn>=0.14.0" spaces
27
 
28
 
29
+ # COPY --link --chown=1000 ./ /home/user/app
30
 
31
+ # COPY --from=pipfreeze --link --chown=1000 /tmp/freeze.txt /tmp/freeze.txt
32
 
33
+ # CMD ["python", "app.py"]
34
 
35
 
36
+ FROM python:3.9
37
+
38
+ WORKDIR /code
39
+
40
+ COPY ./requirements.txt /code/requirements.txt
41
 
42
+ COPY ./packages.txt /code/packages.txt
43
+ RUN --mount=target=/code/packages.txt,source=packages.txt apt-get update && xargs -r -a /code/packages.txt apt-get install -y && apt-get install -y curl && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* && apt-get clean
44
+ RUN ln -s /usr/lib/python3/dist-packages/uno.py /usr/local/lib/python3.10/site-packages/
45
+ RUN ln -s /usr/lib/python3/dist-packages/unohelper.py /usr/local/lib/python3.10/site-packages/
46
 
 
47
 
48
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
49
 
50
+ # Set up a new user named "user" with user ID 1000
51
+ RUN useradd -m -u 1000 user
52
+ # Switch to the "user" user
53
+ USER user
54
+ # Set home to the user's home directory
55
+ ENV HOME=/home/user \
56
+ PATH=/home/user/.local/bin:$PATH
57
 
58
+ # Set the working directory to the user's home directory
59
+ WORKDIR $HOME/app
60
 
61
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
62
+ COPY --chown=user . $HOME/app
63
 
64
 
65
 
66
+ #COPY . .
67
+ CMD ["python","app.py"]