-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add non-streaming cypher generation endpoint #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
njosh13
wants to merge
3
commits into
FalkorDB:master
Choose a base branch
from
njosh13:feat/add-generate-cypher-endpoint
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+280
−59
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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"] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.