Skip to content

Commit

Permalink
Merge pull request #44 from PromptPal/update-dockerfile-remove-sqlite3
Browse files Browse the repository at this point in the history
feat(db): remove sqlite3 support
  • Loading branch information
AnnatarHe committed May 8, 2024
2 parents 113050c + 19f90e6 commit f740861
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 12 deletions.
7 changes: 3 additions & 4 deletions .env.example
Expand Up @@ -3,12 +3,11 @@ JWT_TOKEN_KEY="SOME_RANDOM_KEY_HERE"
HASHID_SALT="SOME_RANDOM_KEY_HERE"
PUBLIC_DOMAIN="0.0.0.0:7788"

# mysql, postgres or sqlite3
DB_TYPE="sqlite3"
# for SQLite: file:./db.db?mode=memory&cache=shared&_fk=1
# mysql, postgres
DB_TYPE="postgres"
# for MySQL: root:pass@tcp(localhost:3306)/test
# for Postgres: host=127.0.0.1 user=postgres password=PASSWORD port=5432 dbname=promptpal sslmode=disable
DB_DSN="file:./db.db?cache=shared&_fk=1"
DB_DSN="127.0.0.1 user=postgres password=PASSWORD port=5432 dbname=promptpal sslmode=disable"

ADMIN_LIST=0x4910c609fBC895434a0A5E3E46B1Eb4b64Cff2B8,0x7E63d899676756711d29DD989bb9F5a868C20e1D
OPENAI_BASE_URL="https://api.openai.com/v1"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_requests.yaml
Expand Up @@ -57,6 +57,6 @@ jobs:
- name: Build
env:
GOARCH: amd64
CGO_ENABLED: 1
CGO_ENABLED: 0
GOOS: linux
run: make release
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Expand Up @@ -57,7 +57,7 @@ jobs:
if: ${{ steps.release.outputs.release_created }}
env:
GOARCH: amd64
CGO_ENABLED: 1
CGO_ENABLED: 0
GOOS: linux
run: |
make release
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,7 +1,7 @@
FROM alpine:latest
LABEL AUTHOR="AnnatarHe<Annatar.He+docker@gmail.com>"

RUN apk --no-cache --update add ca-certificates gcc musl-dev libc6-compat
RUN apk --no-cache --update add ca-certificates
WORKDIR /usr/app

COPY up-pp-api .
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -2,4 +2,4 @@ release: export GOOS=linux
release: export GOARCH=amd64

release:
go build -ldflags="-linkmode external -extldflags '-static' -s -w -X main.GitCommit=${GITHUB_SHA}" -tags release,musl -o up-pp-api main.go
go build -ldflags="-s -w -X main.GitCommit=${GITHUB_SHA}" -tags release -o up-pp-api main.go
4 changes: 1 addition & 3 deletions go.mod
Expand Up @@ -2,8 +2,6 @@ module github.com/PromptPal/PromptPal

go 1.22

exclude github.com/mattn/go-sqlite3 v2.0.3+incompatible

exclude github.com/crate-crypto/go-kzg-4844 v1.0.0

require (
Expand All @@ -23,7 +21,6 @@ require (
github.com/joho/godotenv v1.5.1
github.com/kelseyhightower/envconfig v1.4.0
github.com/lib/pq v1.10.9
github.com/mattn/go-sqlite3 v1.14.22
github.com/sashabaranov/go-openai v1.20.5
github.com/sirupsen/logrus v1.9.3
github.com/speps/go-hashids/v2 v2.0.1
Expand Down Expand Up @@ -80,6 +77,7 @@ require (
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand Down
1 change: 0 additions & 1 deletion service/db.go
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/PromptPal/PromptPal/ent"
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
_ "github.com/mattn/go-sqlite3"
"github.com/sirupsen/logrus"
)

Expand Down

0 comments on commit f740861

Please sign in to comment.