-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1109 from leonsgithub/main
Add docker
- Loading branch information
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,6 @@ | ||
.git | ||
.gitignore | ||
.env | ||
README.md | ||
docker-compose.yml | ||
Dockerfile |
This file contains 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,41 @@ | ||
# Use official golang image as builder | ||
FROM golang:1.22.5-alpine AS builder | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy go mod and sum files | ||
COPY go.mod go.sum ./ | ||
|
||
# Download dependencies | ||
RUN go mod download | ||
|
||
# Copy source code | ||
COPY . . | ||
|
||
# Build the application | ||
RUN CGO_ENABLED=0 GOOS=linux go build -o fabric | ||
|
||
# Use scratch as final base image | ||
FROM alpine:latest | ||
|
||
# Copy the binary from builder | ||
COPY --from=builder /app/fabric /fabric | ||
|
||
# Copy patterns directory | ||
COPY patterns /patterns | ||
|
||
# Ensure clean config directory and copy ENV file | ||
RUN rm -rf /root/.config/fabric && \ | ||
mkdir -p /root/.config/fabric | ||
COPY ENV /root/.config/fabric/.env | ||
|
||
# Add debug commands | ||
RUN ls -la /root/.config/fabric/ | ||
|
||
# Expose port 8080 | ||
EXPOSE 8080 | ||
|
||
# Run the binary with debug output | ||
ENTRYPOINT ["/fabric"] | ||
CMD ["--serve"] |
This file contains 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,9 @@ | ||
DEFAULT_VENDOR=OpenRouter | ||
DEFAULT_MODEL=openai/gpt-3.5-turbo-0125 | ||
DEFAULT_MODEL_CONTEXT_LENGTH=128K | ||
PATTERNS_LOADER_GIT_REPO_URL=https://github.com/danielmiessler/fabric.git | ||
PATTERNS_LOADER_GIT_REPO_PATTERNS_FOLDER=patterns | ||
OPENROUTER_API_KEY=sk-or-v1- | ||
OPENROUTER_API_BASE_URL=https://openrouter.ai/api/v1 | ||
YOUTUBE_API_KEY=AIzaS | ||
JINA_AI_API_KEY=jina_57 |
This file contains 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,11 @@ | ||
version: '3.8' | ||
|
||
services: | ||
fabric-api: | ||
build: . | ||
ports: | ||
- "8080:8080" | ||
volumes: | ||
- ./ENV:/root/.config/fabric/.env:ro | ||
environment: | ||
- GIN_MODE=release |