diff --git a/Dockerfile b/Dockerfile index 25b12e2..1cef79d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,20 +27,22 @@ COPY . . RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ -ldflags='-w -s -extldflags "-static"' -a \ - -o /go/bin/teldrive . + -o /app/teldrive . FROM scratch +WORKDIR /app + COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /etc/passwd /etc/passwd COPY --from=builder /etc/group /etc/group -COPY --from=builder /go/bin/teldrive /go/bin/teldrive +COPY --from=builder /app/teldrive /app/teldrive USER appuser:appuser EXPOSE 8080 -ENTRYPOINT ["/go/bin/teldrive"] \ No newline at end of file +ENTRYPOINT ["/app/teldrive"] \ No newline at end of file diff --git a/database/database.go b/database/database.go index ae3b4d0..87b6282 100644 --- a/database/database.go +++ b/database/database.go @@ -6,7 +6,7 @@ import ( "time" "github.com/divyam234/teldrive/utils" - "github.com/pressly/goose" + "github.com/pressly/goose/v3" "gorm.io/driver/postgres" "gorm.io/gorm" "gorm.io/gorm/logger" diff --git a/docker-compose.yml b/docker-compose.yml index 78182fe..338f854 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,6 +7,7 @@ services: container_name: server volumes: - ./sessions:/app/sessions + - ./database:/app/database env_file: .env ports: - 8080 diff --git a/go.mod b/go.mod index 8ca3d0b..2e7bbea 100644 --- a/go.mod +++ b/go.mod @@ -56,6 +56,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pelletier/go-toml/v2 v2.0.8 // indirect github.com/pressly/goose v2.7.0+incompatible + github.com/pressly/goose/v3 v3.15.0 github.com/segmentio/asm v1.2.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect github.com/ugorji/go/codec v1.2.11 // indirect diff --git a/go.sum b/go.sum index f4331fd..70e588e 100644 --- a/go.sum +++ b/go.sum @@ -131,6 +131,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pressly/goose v2.7.0+incompatible h1:PWejVEv07LCerQEzMMeAtjuyCKbyprZ/LBa6K5P0OCQ= github.com/pressly/goose v2.7.0+incompatible/go.mod h1:m+QHWCqxR3k8D9l7qfzuC/djtlfzxr34mozWDYEu1z8= +github.com/pressly/goose/v3 v3.15.0 h1:6tY5aDqFknY6VZkorFGgZtWygodZQxfmmEF4rqyJW9k= +github.com/pressly/goose/v3 v3.15.0/go.mod h1:LlIo3zGccjb/YUgG+Svdb9Er14vefRdlDI7URCDrwYo= github.com/quantumsheep/range-parser v1.1.0 h1:k4f1F58f8FF54FBYc9dYBRM+8JkAxFo11gC3IeMH4rU= github.com/quantumsheep/range-parser v1.1.0/go.mod h1:acv4Vt2PvpGvRsvGju7Gk2ahKluZJsIUNR69W53J22I= github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=