Update Dockerfile
Browse files- Dockerfile +10 -9
Dockerfile
CHANGED
|
@@ -3,12 +3,16 @@ FROM python:3.10-slim
|
|
| 3 |
# 1. SETUP SYSTEM (ROOT)
|
| 4 |
USER root
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
-
curl git procps
|
| 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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
RUN ln -s $(command -v node) /usr/local/bin/python-internal-service && \
|
| 13 |
printf "#!/bin/bash\n\
|
| 14 |
export NODE_OPTIONS='--dns-result-order=ipv4first'\n\
|
|
@@ -17,17 +21,14 @@ if [ -f 'bot.js' ]; then python-internal-service bot.js & fi\n\
|
|
| 17 |
python main.py\n" > /usr/local/bin/start-app && \
|
| 18 |
chmod +x /usr/local/bin/start-app
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
RUN useradd -m -u 1000 user
|
|
|
|
| 22 |
WORKDIR /home/user
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
RUN pip install --no-cache-dir fastapi uvicorn httpx websockets
|
| 26 |
-
|
| 27 |
-
# 3. FINAL COPY
|
| 28 |
USER user
|
| 29 |
COPY --chown=user:user . .
|
| 30 |
|
| 31 |
EXPOSE 7860
|
| 32 |
-
# Panggil script global yang sudah kita buat tadi
|
| 33 |
CMD ["start-app"]
|
|
|
|
| 3 |
# 1. SETUP SYSTEM (ROOT)
|
| 4 |
USER root
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
+
curl git procps 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. INSTALL TTYD MANUALLY (Fix Error Locate Package)
|
| 12 |
+
RUN curl -fsSL https://github.com/tsl0922/ttyd/releases/download/1.7.3/ttyd.x86_64 -o /usr/local/bin/ttyd && \
|
| 13 |
+
chmod +x /usr/local/bin/ttyd
|
| 14 |
+
|
| 15 |
+
# 3. MASKING & SCRIPT GLOBAL
|
| 16 |
RUN ln -s $(command -v node) /usr/local/bin/python-internal-service && \
|
| 17 |
printf "#!/bin/bash\n\
|
| 18 |
export NODE_OPTIONS='--dns-result-order=ipv4first'\n\
|
|
|
|
| 21 |
python main.py\n" > /usr/local/bin/start-app && \
|
| 22 |
chmod +x /usr/local/bin/start-app
|
| 23 |
|
| 24 |
+
# 4. USER PREP & PYTHON DEPS
|
| 25 |
+
RUN useradd -m -u 1000 user && \
|
| 26 |
+
pip install --no-cache-dir fastapi uvicorn httpx websockets
|
| 27 |
WORKDIR /home/user
|
| 28 |
|
| 29 |
+
# 5. FINAL COPY
|
|
|
|
|
|
|
|
|
|
| 30 |
USER user
|
| 31 |
COPY --chown=user:user . .
|
| 32 |
|
| 33 |
EXPOSE 7860
|
|
|
|
| 34 |
CMD ["start-app"]
|