Create Dockerfile
Browse files- Dockerfile +48 -0
Dockerfile
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM zilliz/gptcache:0.1.29
|
| 2 |
+
|
| 3 |
+
CMD []
|
| 4 |
+
|
| 5 |
+
RUN apt-get update && \
|
| 6 |
+
apt-get install -y curl && \
|
| 7 |
+
apt-get install -y git && \
|
| 8 |
+
curl -sL https://deb.nodesource.com/setup_18.x | bash - && \
|
| 9 |
+
apt-get update && \
|
| 10 |
+
apt-get install -y nodejs
|
| 11 |
+
|
| 12 |
+
RUN git clone https://github.com/PlusLemon/oai-cache-proxy.git /app
|
| 13 |
+
WORKDIR /app
|
| 14 |
+
RUN git rev-parse --short HEAD
|
| 15 |
+
RUN npm install
|
| 16 |
+
COPY Dockerfile greeting.md* .env* ./
|
| 17 |
+
RUN npm run build
|
| 18 |
+
|
| 19 |
+
EXPOSE 7860
|
| 20 |
+
ENV NODE_ENV=production
|
| 21 |
+
ENV GATEKEEPER=proxy_key
|
| 22 |
+
USER root
|
| 23 |
+
|
| 24 |
+
# RUN pip3 install --no-cache-dir sacremoses
|
| 25 |
+
|
| 26 |
+
RUN echo 'embedding: huggingface' > /app/cache.yml && \
|
| 27 |
+
echo 'embedding_config:' >> /app/cache.yml && \
|
| 28 |
+
echo ' model: uer/albert-base-chinese-cluecorpussmall' >> /app/cache.yml && \
|
| 29 |
+
# RUN echo 'embedding: paddlenlp' > /app/cache.yml && \
|
| 30 |
+
echo 'config:' >> /app/cache.yml && \
|
| 31 |
+
echo ' similarity_threshold: 0.9' >> /app/cache.yml
|
| 32 |
+
|
| 33 |
+
RUN echo '#!/bin/bash' > /app/startup-script.sh && \
|
| 34 |
+
echo 'gptcache_server -s 0.0.0.0 -f /app/cache.yml &' >> /app/startup-script.sh && \
|
| 35 |
+
echo 'npm start' >> /app/startup-script.sh && \
|
| 36 |
+
chmod +x /app/startup-script.sh
|
| 37 |
+
|
| 38 |
+
RUN mkdir /.npm && \
|
| 39 |
+
mkdir -p /.local/bin && \
|
| 40 |
+
mkdir -p /.cache/pip && \
|
| 41 |
+
mkdir gptcache_data && \
|
| 42 |
+
chown -R 1000:0 "/.npm" "/.local" "/.cache" "/usr/local" "gptcache_data"
|
| 43 |
+
|
| 44 |
+
RUN python3 -m pip install --upgrade pip
|
| 45 |
+
|
| 46 |
+
ENV PATH="/.local/bin:$PATH"
|
| 47 |
+
|
| 48 |
+
ENTRYPOINT sh -c "/app/startup-script.sh"
|