gcliapi / Dockerfile
gongzizhongyang's picture
Update Dockerfile
4eaeb30 verified
FROM ghcr.io/su-kaka/gcli2api:latest
ENV PORT=7860
EXPOSE 7860
RUN mkdir -p /app/creds && chmod 777 /app/creds && \
apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
CMD sh -c '\
if [ -n "$GCLI_JSON" ]; then echo "$GCLI_JSON" > /tmp/gcli.json; fi && \
if [ -n "$AG_JSON" ]; then echo "$AG_JSON" > /tmp/ag.json; fi && \
python web.py & \
sleep 20 && \
if [ -f /tmp/gcli.json ]; then \
curl -s -X POST "http://127.0.0.1:7860/creds/upload?mode=geminicli" \
-H "Authorization: Bearer $PASSWORD" \
-F "files=@/tmp/gcli.json" ; \
echo "✅ GCLI凭证已导入"; \
fi && \
if [ -f /tmp/ag.json ]; then \
curl -s -X POST "http://127.0.0.1:7860/creds/upload?mode=antigravity" \
-H "Authorization: Bearer $PASSWORD" \
-F "files=@/tmp/ag.json" ; \
echo "✅ AG凭证已导入"; \
fi && \
wait'