pluviouse commited on
Commit
5016a6b
·
verified ·
1 Parent(s): f68b5ae

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +45 -11
Dockerfile CHANGED
@@ -1,16 +1,50 @@
1
- # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
 
4
- FROM python:3.9
5
 
6
- RUN useradd -m -u 1000 user
7
- USER user
8
- ENV PATH="/home/user/.local/bin:$PATH"
9
 
10
- WORKDIR /app
 
 
 
 
 
11
 
12
- COPY --chown=user ./requirements.txt requirements.txt
13
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
- COPY --chown=user . /app
16
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM debian:10
 
2
 
 
3
 
4
+ ENV CHROME_BIN=/usr/bin/chromium
5
+ ENV DEBIAN_FRONTEND=noninteractive
 
6
 
7
+ ENV TZ=Asia/Jakarta
8
+ ENV USERNAME=yuzu
9
+ ENV HOSTNAME=wonderland
10
+ ENV BOT_DIR=bot
11
+ ENV PORT=7860
12
+
13
 
14
+ RUN apt-get update
15
+ RUN apt-get install -y \
16
+ software-properties-common \
17
+ bash
18
+
19
+ RUN apt-get install -y \
20
+ git \
21
+ curl \
22
+ chromium \
23
+ unzip \
24
+ ffmpeg \
25
+ webp \
26
+ neofetch \
27
+ build-essential
28
+
29
+ RUN rm -rf /var/lib/apt/lists/*
30
 
31
+ RUN curl https://pkgx.sh | sh
32
+
33
+ RUN useradd -m -u 1000 $USERNAME
34
+
35
+ #END OF ROOT USER#
36
+
37
+ USER $USERNAME
38
+
39
+ ENV HOME=/home/$USERNAME
40
+ ENV PATH=/home/$USERNAME/.local/bin:$PATH
41
+ ENV WORKDIR=$HOME/$BOT_DIR
42
+
43
+ WORKDIR $WORKDIR
44
+ COPY --chown=$USERNAME . $WORKDIR
45
+
46
+ RUN pkgx pip3 install -r requirements.txt
47
+ EXPOSE $PORT
48
+ RUN chmod -R 777 $WORKDIR
49
+
50
+ CMD ["pkgx", "python", "app.py"]