Skip to content
Open
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
28 changes: 26 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,36 @@
# Copy this file to .env and configure your default values

# Default AI model to use when not specified in requests
# Examples: "gpt-4", "gpt-3.5-turbo", "claude-3-sonnet", etc.
# Examples:
# OpenAI: "gpt-4", "gpt-3.5-turbo", "gpt-4o"
# Anthropic: "claude-3-sonnet", "claude-3-opus"
# Groq: "llama-3.1-8b-instant", "mixtral-8x7b-32768"
# Kimi K2 (via Groq): "moonshotai/kimi-k2-instruct"
DEFAULT_MODEL=gpt-4

# Default API key for the AI model
# This will be used when no key is provided in the request
# For Groq models (including Kimi K2), use your Groq API key
DEFAULT_KEY=your-api-key-here

# optional
# Provider-specific API keys (optional)
# genai will auto-detect the provider and use the appropriate key
# OPENAI_API_KEY=your-openai-key-here
# ANTHROPIC_API_KEY=your-anthropic-key-here
# GROQ_API_KEY=your-groq-key-here

# FalkorDB connection string (optional)
# FALKORDB_CONNECTION=falkor://127.0.0.1:6379

# =============================================================================
# KIMI K2 VIA GROQ CONFIGURATION
# =============================================================================
# To use Kimi K2 (Moonshot AI) via Groq:
# 1. Set DEFAULT_MODEL=moonshotai/kimi-k2-instruct
# 2. Set GROQ_API_KEY=your_groq_api_key (or DEFAULT_KEY=your_groq_api_key)
# 3. The ModelMapper will automatically route moonshotai/kimi-k2* models to Groq
#
# Example:
# DEFAULT_MODEL=moonshotai/kimi-k2-instruct
# GROQ_API_KEY=gsk_...your-groq-key
# =============================================================================
67 changes: 67 additions & 0 deletions Dockerfile.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Build stage - Build from source to include code changes
FROM rust:alpine AS builder

# Install build dependencies
RUN apk add --no-cache musl-dev openssl-dev pkgconfig curl

# Set working directory
WORKDIR /app

# Copy Cargo files
COPY Cargo.toml Cargo.lock ./

# Copy source code
COPY src ./src
COPY templates ./templates

# Build the application in release mode
RUN cargo build --release

# Runtime stage - Use FalkorDB as base image
FROM falkordb/falkordb:latest

# Install runtime dependencies and supervisord
RUN apt-get update && apt-get install -y ca-certificates supervisor && rm -rf /var/lib/apt/lists/*

# Create a non-root user for security (if not already exists)
RUN if ! getent group appuser >/dev/null; then \
groupadd -g 1000 appuser; \
fi && \
if ! getent passwd appuser >/dev/null; then \
useradd -m -s /bin/bash -u 1000 -g appuser appuser; \
fi

# Set the working directory for our application
WORKDIR /app

# Copy the compiled binary from the builder stage
COPY --from=builder /app/target/release/text-to-cypher /app/text-to-cypher

# Copy the templates from the builder stage
COPY --from=builder /app/templates ./templates

# Create import directory and set permissions
# Note: Using /var/lib/falkordb as the primary data directory path
RUN mkdir -p /var/lib/falkordb/import && \
mkdir -p /tmp/falkordb-import && \
chown -R appuser:appuser /var/lib/falkordb && \
chown -R appuser:appuser /tmp/falkordb-import && \
chmod -R 755 /var/lib/falkordb && \
chmod -R 755 /tmp/falkordb-import

# Change ownership to the non-root user
RUN chown -R appuser:appuser /app

# Expose the ports your application runs on (in addition to FalkorDB's ports)
EXPOSE 8080 3001

# Copy supervisord configuration and scripts
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY entrypoint.sh /entrypoint.sh

# Create supervisor log directory and make scripts executable
RUN mkdir -p /var/log/supervisor && \
chmod +x /entrypoint.sh

# Use ENTRYPOINT instead of CMD to ensure it runs
ENTRYPOINT ["/entrypoint.sh"]
Loading