Skip to content

Commit

Permalink
squash
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasthomas committed Jun 17, 2024
1 parent 7ad7968 commit 37a0006
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,12 @@ services:
- postgres-data:/var/lib/postgresql/data

qdrant:
image: generall/qdrant
image: qdrant/qdrant
ports:
- "6333:6333"
volumes:
- qdrant-data:/qdrant/storage

goapp:
build: ./goapp
ports:
- "8080:8080"
depends_on:
- postgres
- qdrant
environment:
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
POSTGRES_USER: youruser
POSTGRES_PASSWORD: yourpassword
POSTGRES_DB: yourdbname
QDRANT_HOST: qdrant
QDRANT_PORT: 6333

volumes:
postgres-data:
qdrant-data:
7 changes: 7 additions & 0 deletions ai/boilerplate/goapp/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=youruser
POSTGRES_PASSWORD=yourpassword
POSTGRES_DB=yourdbname
QDRANT_HOST=localhost
QDRANT_PORT=6333
8 changes: 8 additions & 0 deletions ai/boilerplate/goapp/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module goapp

go 1.22.3

require (
github.com/joho/godotenv v1.5.1
github.com/lib/pq v1.10.9
)
4 changes: 4 additions & 0 deletions ai/boilerplate/goapp/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ import (
"net/http"
"os"

"github.com/joho/godotenv"
_ "github.com/lib/pq"
)

func main() {
// Load .env file
err := godotenv.Load()
if err != nil {
log.Fatalf("Error loading .env file: %v", err)
}

// Connect to PostgreSQL
pgConnStr := fmt.Sprintf("host=%s port=%s user=%s password=%s dbname=%s sslmode=disable",
os.Getenv("POSTGRES_HOST"), os.Getenv("POSTGRES_PORT"), os.Getenv("POSTGRES_USER"), os.Getenv("POSTGRES_PASSWORD"), os.Getenv("POSTGRES_DB"))
Expand Down
13 changes: 0 additions & 13 deletions ai/boilterplate/goapp/Dockerfile

This file was deleted.

5 changes: 0 additions & 5 deletions ai/boilterplate/goapp/go.mod

This file was deleted.

2 changes: 0 additions & 2 deletions ai/boilterplate/goapp/go.sum

This file was deleted.

0 comments on commit 37a0006

Please sign in to comment.