Update Dockerfile
Browse files- Dockerfile +12 -25
Dockerfile
CHANGED
|
@@ -1,39 +1,26 @@
|
|
| 1 |
FROM ghcr.io/danny-avila/librechat-dev:latest
|
|
|
|
|
|
|
| 2 |
EXPOSE 3080
|
| 3 |
EXPOSE 8000
|
| 4 |
|
| 5 |
-
# Set environment variables
|
| 6 |
ENV HOST=0.0.0.0
|
| 7 |
ENV PORT=3080
|
| 8 |
ENV SESSION_EXPIRY=900000
|
| 9 |
ENV REFRESH_TOKEN_EXPIRY=604800000
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
# ENV SEARCH=true
|
| 15 |
-
# ENV MEILI_NO_ANALYTICS=true
|
| 16 |
-
# ENV MEILI_HOST=https://librechat-meilisearch.hf.space
|
| 17 |
-
# ENV MEILI_HTTP_ADDR=https://librechat-meilisearch.hf.space
|
| 18 |
-
|
| 19 |
-
# Create necessary directories
|
| 20 |
-
RUN mkdir -p /app/uploads/temp
|
| 21 |
-
RUN mkdir -p /app/client/public/images/temp
|
| 22 |
-
RUN mkdir -p /app/api/logs/
|
| 23 |
-
RUN mkdir -p /app/data
|
| 24 |
-
|
| 25 |
-
# Give write permission to the directory
|
| 26 |
-
RUN chmod -R 777 /app/uploads/temp
|
| 27 |
-
RUN chmod -R 777 /app/client/public/images
|
| 28 |
-
RUN chmod -R 777 /app/api/logs/
|
| 29 |
-
RUN chmod -R 777 /app/data
|
| 30 |
|
| 31 |
-
# Copy Custom Endpoints Config
|
| 32 |
RUN curl -o /app/librechat.yaml https://raw.githubusercontent.com/fuegovic/lc-config-yaml/main/librechat-rw.yaml
|
| 33 |
-
COPY librechat.yaml /app/librechat.yaml
|
| 34 |
|
| 35 |
-
# Install dependencies
|
| 36 |
RUN cd /app/api && npm install
|
| 37 |
|
| 38 |
-
#
|
| 39 |
-
CMD
|
|
|
|
|
|
| 1 |
FROM ghcr.io/danny-avila/librechat-dev:latest
|
| 2 |
+
|
| 3 |
+
# Expose ports (3080 for LibreChat, 8000 for RAG API)
|
| 4 |
EXPOSE 3080
|
| 5 |
EXPOSE 8000
|
| 6 |
|
| 7 |
+
# Set environment variables (minimal set - the rest go in HF Spaces settings)
|
| 8 |
ENV HOST=0.0.0.0
|
| 9 |
ENV PORT=3080
|
| 10 |
ENV SESSION_EXPIRY=900000
|
| 11 |
ENV REFRESH_TOKEN_EXPIRY=604800000
|
| 12 |
|
| 13 |
+
# Create directories and set permissions
|
| 14 |
+
RUN mkdir -p /app/uploads/temp /app/client/public/images/temp /app/api/logs/ /app/data
|
| 15 |
+
RUN chmod -R 777 /app/uploads/temp /app/client/public/images /app/api/logs/ /app/data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
# Copy Custom Endpoints Config (keep as is for now)
|
| 18 |
RUN curl -o /app/librechat.yaml https://raw.githubusercontent.com/fuegovic/lc-config-yaml/main/librechat-rw.yaml
|
| 19 |
+
# COPY librechat.yaml /app/librechat.yaml # Uncomment this to use a local file instead
|
| 20 |
|
| 21 |
+
# Install api dependencies
|
| 22 |
RUN cd /app/api && npm install
|
| 23 |
|
| 24 |
+
# START RAG API (This is the crucial addition)
|
| 25 |
+
# We use a single CMD to start both the backend AND the RAG API in the background.
|
| 26 |
+
CMD (npm run backend &) && (cd /app/api/rag && uvicorn main:app --host 0.0.0.0 --port 8000)
|