| FROM docker.io/soulter/astrbot:latest |
|
|
| USER root |
|
|
| |
| RUN apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN echo 'server { \ |
| listen 7860; \ |
| client_max_body_size 50M; \ |
| \ |
| location /health { \ |
| return 200 "OK\n"; \ |
| add_header Content-Type text/plain; \ |
| } \ |
| \ |
| location /ws { \ |
| proxy_pass http://127.0.0.1:6199; \ |
| proxy_http_version 1.1; \ |
| proxy_set_header Upgrade $http_upgrade; \ |
| proxy_set_header Connection "upgrade"; \ |
| proxy_set_header Host $host; \ |
| proxy_read_timeout 86400; \ |
| } \ |
| \ |
| location / { \ |
| proxy_pass http://127.0.0.1:6185; \ |
| proxy_set_header Host $host; \ |
| proxy_set_header X-Real-IP $remote_addr; \ |
| } \ |
| }' > /etc/nginx/sites-enabled/default |
|
|
| |
| RUN echo ' |
| nginx &\n\ |
| cd /AstrBot && python main.py\n\ |
| ' > /entrypoint.sh && chmod +x /entrypoint.sh |
|
|
| EXPOSE 7860 |
|
|
| ENTRYPOINT ["/entrypoint.sh"] |