ws / Dockerfile
2ch's picture
Update Dockerfile
ed96a6c verified
FROM archlinux:base
WORKDIR /app
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm curl git bun && \
pacman -Scc --noconfirm && \
mkdir -p /opt/windsurf/data/db && \
git clone --depth 1 https://github.com/dwgx/WindsurfAPI.git . && \
bash install-ls.sh
COPY <<-"EOF" /app/resolv.conf
nameserver 1.1.1.1
nameserver 1.0.0.1
nameserver 2606:4700:4700::1111
nameserver 2606:4700:4700::1002
EOF
COPY --chmod=755 <<-"EOF" /entrypoint.sh
#!/bin/sh
cat /app/resolv.conf > /etc/resolv.conf
exec "$@"
EOF
COPY <<-"EOF" /app/.env
PORT=7860
HOST=0.0.0.0
DEFAULT_MODEL=gemini-2.5-flash
LOG_LEVEL=warn
LS_BINARY_PATH=/opt/windsurf/language_server_linux_x64
LS_PORT=42100
# это вынесено в секреты на вкладке настроек:
# DASHBOARD_PASSWORD
# API_KEY
EOF
COPY <<-"EOF" /tmp/patch.js
const server = startServer();
log.warn("\n\n==========================================\n\n⚠️ GO TO https://USERNAME-SPACENAME.hf.space/dashboard\n\n==========================================\n\n")
EOF
RUN sed -i -e '/const server = startServer();/r /tmp/patch.js' -e '/const server = startServer();/d' /app/src/index.js && \
rm /tmp/patch.js
EXPOSE 42100
ENTRYPOINT ["/entrypoint.sh"]
CMD ["bun", "/app/src/index.js"]