Create Dockerfile
Browse files- Dockerfile +105 -0
Dockerfile
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# syntax=docker/dockerfile:1
|
| 2 |
+
# ^^^ ЭТО ОБЯЗАТЕЛЬНО для heredoc в Dockerfile
|
| 3 |
+
|
| 4 |
+
# ============================================
|
| 5 |
+
# BASE
|
| 6 |
+
# ============================================
|
| 7 |
+
FROM python:3.11-slim
|
| 8 |
+
|
| 9 |
+
RUN apt-get update && apt-get install -y \
|
| 10 |
+
supervisor \
|
| 11 |
+
curl \
|
| 12 |
+
git \
|
| 13 |
+
wget \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
+
|
| 16 |
+
# ============================================
|
| 17 |
+
# ZROK
|
| 18 |
+
# ============================================
|
| 19 |
+
RUN curl -sSf https://get.openziti.io/install.bash | bash -s zrok
|
| 20 |
+
|
| 21 |
+
# ============================================
|
| 22 |
+
# SECTION: AIClient2API
|
| 23 |
+
# ============================================
|
| 24 |
+
RUN git clone https://github.com/user/AIClient2API.git /data/aiclient2api \
|
| 25 |
+
&& pip install --no-cache-dir -r /data/aiclient2api/requirements.txt
|
| 26 |
+
|
| 27 |
+
# ============================================
|
| 28 |
+
# SECTION: Kiro-go
|
| 29 |
+
# ============================================
|
| 30 |
+
RUN mkdir -p /data/kirogo \
|
| 31 |
+
&& wget -O /data/kirogo/kiro-go \
|
| 32 |
+
https://github.com/user/kiro-go/releases/download/v1.0/kiro-go-linux-amd64 \
|
| 33 |
+
&& chmod +x /data/kirogo/kiro-go
|
| 34 |
+
|
| 35 |
+
# ============================================
|
| 36 |
+
# SECTION: Bifrost
|
| 37 |
+
# ============================================
|
| 38 |
+
RUN git clone https://github.com/user/bifrost.git /data/bifrost \
|
| 39 |
+
&& pip install --no-cache-dir -r /data/bifrost/requirements.txt
|
| 40 |
+
|
| 41 |
+
# ============================================
|
| 42 |
+
# CONFIGS — всё inline, никаких внешних файлов
|
| 43 |
+
# ============================================
|
| 44 |
+
|
| 45 |
+
# supervisord.conf прямо в Dockerfile
|
| 46 |
+
COPY <<EOF /etc/supervisor/conf.d/supervisord.conf
|
| 47 |
+
[supervisord]
|
| 48 |
+
nodaemon=true
|
| 49 |
+
logfile=/dev/stdout
|
| 50 |
+
logfile_maxbytes=0
|
| 51 |
+
|
| 52 |
+
[program:bifrost]
|
| 53 |
+
command=python /data/bifrost/main.py --port 7860
|
| 54 |
+
directory=/data/bifrost
|
| 55 |
+
autostart=true
|
| 56 |
+
autorestart=true
|
| 57 |
+
stdout_logfile=/dev/stdout
|
| 58 |
+
stdout_logfile_maxbytes=0
|
| 59 |
+
stderr_logfile=/dev/stderr
|
| 60 |
+
stderr_logfile_maxbytes=0
|
| 61 |
+
|
| 62 |
+
[program:aiclient]
|
| 63 |
+
command=python /data/aiclient2api/main.py --port 8081
|
| 64 |
+
directory=/data/aiclient2api
|
| 65 |
+
autostart=true
|
| 66 |
+
autorestart=true
|
| 67 |
+
stdout_logfile=/dev/stdout
|
| 68 |
+
stdout_logfile_maxbytes=0
|
| 69 |
+
stderr_logfile=/dev/stderr
|
| 70 |
+
stderr_logfile_maxbytes=0
|
| 71 |
+
|
| 72 |
+
[program:kirogo]
|
| 73 |
+
command=/data/kirogo/kiro-go --port 8082
|
| 74 |
+
directory=/data/kirogo
|
| 75 |
+
autostart=true
|
| 76 |
+
autorestart=true
|
| 77 |
+
stdout_logfile=/dev/stdout
|
| 78 |
+
stdout_logfile_maxbytes=0
|
| 79 |
+
stderr_logfile=/dev/stderr
|
| 80 |
+
stderr_logfile_maxbytes=0
|
| 81 |
+
|
| 82 |
+
[program:zrok]
|
| 83 |
+
command=zrok share reserved %(ENV_ZROK_SHARE_NAME)s
|
| 84 |
+
autostart=true
|
| 85 |
+
autorestart=true
|
| 86 |
+
stdout_logfile=/dev/stdout
|
| 87 |
+
stdout_logfile_maxbytes=0
|
| 88 |
+
stderr_logfile=/dev/stderr
|
| 89 |
+
stderr_logfile_maxbytes=0
|
| 90 |
+
EOF
|
| 91 |
+
|
| 92 |
+
# startup скрипт тоже inline
|
| 93 |
+
COPY <<'EOF' /data/start.sh
|
| 94 |
+
#!/bin/bash
|
| 95 |
+
if [ -n "$ZROK_TOKEN" ]; then
|
| 96 |
+
zrok enable $ZROK_TOKEN 2>/dev/null || true
|
| 97 |
+
fi
|
| 98 |
+
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
| 99 |
+
EOF
|
| 100 |
+
|
| 101 |
+
RUN chmod +x /data/start.sh
|
| 102 |
+
|
| 103 |
+
EXPOSE 7860
|
| 104 |
+
|
| 105 |
+
CMD ["/data/start.sh"]
|