Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -15
Dockerfile
CHANGED
|
@@ -1,5 +1,9 @@
|
|
| 1 |
FROM python:3.13-bookworm
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
# Install system dependencies
|
| 4 |
# Use the headless version of openjdk-17, which is standard for server environments
|
| 5 |
RUN apt-get update && \
|
|
@@ -22,17 +26,14 @@ RUN curl -fsSL https://github.com/neo4j/apoc/releases/download/5.15.0/apoc-5.15.
|
|
| 22 |
# Set workdir
|
| 23 |
WORKDIR /app
|
| 24 |
|
| 25 |
-
|
| 26 |
-
# Clone the project
|
| 27 |
-
RUN git clone https://github.com/bhuvanmdev/graph-rag-agent.git /app
|
| 28 |
|
| 29 |
# Create directories for Neo4j data and logs
|
| 30 |
-
# These directories can be bind mounted from the host
|
| 31 |
RUN mkdir -p /app/neo4j_data /app/neo4j_logs
|
| 32 |
|
| 33 |
# === Correct Neo4j Configuration ===
|
| 34 |
-
# Modify neo4j.conf directly instead of using ENV variables
|
| 35 |
-
# Note: Disabling authentication is not recommended for production
|
| 36 |
RUN sed -i 's/#server.default_listen_address=127.0.0.1/server.default_listen_address=0.0.0.0/' /neo4j/conf/neo4j.conf && \
|
| 37 |
sed -i 's|#dbms.directories.data=data|dbms.directories.data=/app/neo4j_data|' /neo4j/conf/neo4j.conf && \
|
| 38 |
sed -i 's|#dbms.directories.logs=logs|dbms.directories.logs=/app/neo4j_logs|' /neo4j/conf/neo4j.conf && \
|
|
@@ -42,23 +43,20 @@ RUN sed -i 's/#server.default_listen_address=127.0.0.1/server.default_listen_add
|
|
| 42 |
RUN pip install --upgrade pip && \
|
| 43 |
pip install -r requirements.txt
|
| 44 |
|
| 45 |
-
|
| 46 |
-
|
|
|
|
| 47 |
apt-get install -y --no-install-recommends git-lfs unzip && \
|
| 48 |
-
export GIT_TOKEN=$(cat /run/secrets/github_pat) && \
|
| 49 |
-
git remote set-url origin https://oauth2:$GIT_TOKEN@github.com/bhuvanmdev/graph-rag-agent.git && \
|
| 50 |
git lfs install && \
|
| 51 |
git lfs pull && \
|
| 52 |
-
unzip
|
| 53 |
rm -rf /var/lib/apt/lists/*
|
| 54 |
|
| 55 |
-
#
|
| 56 |
RUN mv /app/neo4j_data/* /neo4j/data/ && mv /app/neo4j_logs/* /neo4j/logs/
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
| 60 |
# Copy Nginx config and run script
|
| 61 |
-
|
| 62 |
RUN chmod +x /app/scripts/run.sh
|
| 63 |
|
| 64 |
# Expose HTTP (Nginx), Neo4j, and Gradio ports
|
|
|
|
| 1 |
FROM python:3.13-bookworm
|
| 2 |
|
| 3 |
+
# === Step 2.1: DECLARE THE BUILD ARGUMENT ===
|
| 4 |
+
# This line tells Docker to expect a build argument named GITHUB_PAT.
|
| 5 |
+
ARG GITHUB_PAT
|
| 6 |
+
|
| 7 |
# Install system dependencies
|
| 8 |
# Use the headless version of openjdk-17, which is standard for server environments
|
| 9 |
RUN apt-get update && \
|
|
|
|
| 26 |
# Set workdir
|
| 27 |
WORKDIR /app
|
| 28 |
|
| 29 |
+
# === Step 2.2: USE THE BUILD ARGUMENT IN YOUR CLONE COMMAND ===
|
| 30 |
+
# Clone the project using the token for authentication
|
| 31 |
+
RUN git clone https://oauth2:${GITHUB_PAT}@github.com/bhuvanmdev/graph-rag-agent.git /app
|
| 32 |
|
| 33 |
# Create directories for Neo4j data and logs
|
|
|
|
| 34 |
RUN mkdir -p /app/neo4j_data /app/neo4j_logs
|
| 35 |
|
| 36 |
# === Correct Neo4j Configuration ===
|
|
|
|
|
|
|
| 37 |
RUN sed -i 's/#server.default_listen_address=127.0.0.1/server.default_listen_address=0.0.0.0/' /neo4j/conf/neo4j.conf && \
|
| 38 |
sed -i 's|#dbms.directories.data=data|dbms.directories.data=/app/neo4j_data|' /neo4j/conf/neo4j.conf && \
|
| 39 |
sed -i 's|#dbms.directories.logs=logs|dbms.directories.logs=/app/neo4j_logs|' /neo4j/conf/neo4j.conf && \
|
|
|
|
| 43 |
RUN pip install --upgrade pip && \
|
| 44 |
pip install -r requirements.txt
|
| 45 |
|
| 46 |
+
# Install git-lfs, pull LFS files, and unzip. This will now work because the repo
|
| 47 |
+
# was cloned with credentials.
|
| 48 |
+
RUN apt-get update && \
|
| 49 |
apt-get install -y --no-install-recommends git-lfs unzip && \
|
|
|
|
|
|
|
| 50 |
git lfs install && \
|
| 51 |
git lfs pull && \
|
| 52 |
+
unzip neo4j.zip && \
|
| 53 |
rm -rf /var/lib/apt/lists/*
|
| 54 |
|
| 55 |
+
# Move the unzipped data
|
| 56 |
RUN mv /app/neo4j_data/* /neo4j/data/ && mv /app/neo4j_logs/* /neo4j/logs/
|
| 57 |
|
|
|
|
|
|
|
| 58 |
# Copy Nginx config and run script
|
| 59 |
+
COPY nginx.conf /etc/nginx/nginx.conf
|
| 60 |
RUN chmod +x /app/scripts/run.sh
|
| 61 |
|
| 62 |
# Expose HTTP (Nginx), Neo4j, and Gradio ports
|