Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /kg-node
COPY . .
RUN apt-get update && apt-get upgrade -y
RUN apt-get install libssl-dev protobuf-compiler -y
RUN CFLAGS='-std=gnu17' cargo build --release --bin sink --bin api
RUN CFLAGS='-std=gnu17' cargo build --release --bin sink --bin mcp-server

# Run image
FROM debian:bookworm-slim AS run
Expand Down Expand Up @@ -34,11 +34,20 @@ CMD ./sink \
--neo4j-user $neo4j_user \
--neo4j-pass $neo4j_pass

# GraphQL API image
FROM run AS api
COPY --from=builder /kg-node/target/release/api .
# # GraphQL API image
# FROM run AS api
# COPY --from=builder /kg-node/target/release/api .

CMD ./api \
# CMD ./api \
# --neo4j-uri $neo4j_uri \
# --neo4j-user $neo4j_user \
# --neo4j-pass $neo4j_pass

# MCP server image
FROM run AS mcp
COPY --from=builder /kg-node/target/release/mcp-server .

CMD ./mcp-server \
--neo4j-uri $neo4j_uri \
--neo4j-user $neo4j_user \
--neo4j-pass $neo4j_pass
27 changes: 23 additions & 4 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
services:
memcached:
image: memcached:latest
image: memcached:alpine
ports:
- "11211:11211"
healthcheck:
test: echo "version" | (exec 3<>/dev/tcp/localhost/11211; cat >&3; timeout 0.1 cat <&3; exec 3<&-)
test: echo "version" | nc -vn -w 1 127.0.0.1 11211
interval: 1s
timeout: 10s
retries: 20
Expand Down Expand Up @@ -53,11 +53,30 @@ services:
SUBSTREAMS_START_BLOCK: ${SUBSTREAMS_START_BLOCK}
memcached_uri: memcached:11211
memcached_default_expiry: "3600"
api:
# api:
# build:
# context: ..
# dockerfile: docker/Dockerfile
# target: api
# ports:
# - "80:8080"
# depends_on:
# neo4j:
# condition: service_healthy
# memcached:
# condition: service_healthy
# environment:
# neo4j_uri: neo4j://neo4j:7687
# neo4j_user: neo4j
# neo4j_pass: neo4j
# memcached_uri: memcached:11211
# memcached_default_expiry: "3600"

mcp:
build:
context: ..
dockerfile: docker/Dockerfile
target: api
target: mcp
ports:
- "80:8080"
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion mcp-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use tracing_subscriber::{
{self},
};

const BIND_ADDRESS: &str = "127.0.0.1:8000";
const BIND_ADDRESS: &str = "0.0.0.0:8080";

#[tokio::main]
async fn main() -> anyhow::Result<()> {
Expand Down
Loading