Aqso commited on
Commit
89c6af7
·
verified ·
1 Parent(s): e985d89

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -9
Dockerfile CHANGED
@@ -1,24 +1,28 @@
1
  FROM python:3.10-slim
2
 
 
3
  USER root
4
  RUN apt-get update && apt-get install -y \
5
- curl git procps ttyd \
 
 
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
- # Install Node.js & Masking
9
- RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
10
- apt-get install -y nodejs && \
11
- mv /usr/bin/node /usr/bin/python-internal-service && \
12
  ln -s /usr/bin/python-internal-service /usr/local/bin/node-internal
13
 
 
14
  RUN useradd -m -u 1000 user
15
  WORKDIR /home/user
16
 
17
- COPY --chown=user:user requirements.txt .
18
- RUN pip install --no-cache-dir -r requirements.txt
19
-
20
  COPY --chown=user:user . .
21
- RUN chmod +x entrypoint.sh
 
 
 
 
22
 
23
  USER user
24
  EXPOSE 7860
 
1
  FROM python:3.10-slim
2
 
3
+ # 1. ROOT PHASE: Install SEMUA sistem di sini
4
  USER root
5
  RUN apt-get update && apt-get install -y \
6
+ curl git procps ttyd gnupg ca-certificates \
7
+ && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
8
+ && apt-get install -y nodejs \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # 2. MASKING & DNS PREP
12
+ RUN mv /usr/bin/node /usr/bin/python-internal-service && \
 
 
13
  ln -s /usr/bin/python-internal-service /usr/local/bin/node-internal
14
 
15
+ # 3. USER SETUP
16
  RUN useradd -m -u 1000 user
17
  WORKDIR /home/user
18
 
19
+ # 4. FIX: Handle missing requirements.txt agar tidak Exit 1
 
 
20
  COPY --chown=user:user . .
21
+ RUN if [ ! -f requirements.txt ]; then echo "fastapi\nuvicorn\nhttpx\nwebsockets" > requirements.txt; fi \
22
+ && pip install --no-cache-dir -r requirements.txt
23
+
24
+ # 5. PERMISSION FINAL
25
+ RUN chmod +x entrypoint.sh && chown -R user:user /home/user
26
 
27
  USER user
28
  EXPOSE 7860