File size: 998 Bytes
17962f7
 
0833c65
 
17962f7
 
 
 
 
 
 
 
 
 
 
 
 
0833c65
a30f168
 
17962f7
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM node:20-bookworm-slim

ARG WINDSURFAPI_REPO=https://github.com/xiubia/WindsurfAPI.git
ARG WINDSURFAPI_REF=main

ENV NODE_ENV=production \
    PORT=7860 \
    DATA_DIR=/data \
    LS_BINARY_PATH=/opt/windsurf/language_server_linux_x64 \
    LS_PORT=42100

WORKDIR /app

RUN apt-get update \
    && apt-get install -y --no-install-recommends bash ca-certificates curl git \
    && rm -rf /var/lib/apt/lists/* \
    && git clone --depth 1 --branch "$WINDSURFAPI_REF" "$WINDSURFAPI_REPO" /app \
    && npm install --omit=dev \
    && chmod +x /app/install-ls.sh \
    && bash /app/install-ls.sh \
    && mkdir -p /data /opt/windsurf/data/db /tmp/windsurf-workspace

EXPOSE 7860

VOLUME ["/data", "/opt/windsurf", "/tmp/windsurf-workspace"]

HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
  CMD node -e "fetch('http://127.0.0.1:' + (process.env.PORT || 7860) + '/health').then((r) => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"

CMD ["node", "src/index.js"]