From 5b1a1d0038dad920bcdf0130e1eecf1f9766fef4 Mon Sep 17 00:00:00 2001 From: Edmartt <47486245+Edmartt@users.noreply.github.com> Date: Sun, 15 May 2022 11:29:10 -0500 Subject: [PATCH 1/2] update: change Postgres DB to SQLite for easy test --- internal/users/data/repository.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/users/data/repository.go b/internal/users/data/repository.go index adb2ffd..1f20cbc 100644 --- a/internal/users/data/repository.go +++ b/internal/users/data/repository.go @@ -14,7 +14,7 @@ type UserRepository struct{ func NewRepository() *UserRepository{ db := UserRepository{} - db.DB = database.Postgres{} + db.DB = database.SQLite{} return &UserRepository{DB: db.DB} } From d925a56ac47ef9cfc91ccf2a7e840b6850dd5bad Mon Sep 17 00:00:00 2001 From: Edmartt <47486245+Edmartt@users.noreply.github.com> Date: Sun, 15 May 2022 11:29:39 -0500 Subject: [PATCH 2/2] chore: adds dockerfile --- Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3e835ab --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM golang:1.18-alpine + +RUN apk add build-base + +WORKDIR "/app" + +ENV go env -w GO111MODULE=on +ENV CGP_ENABLED=0 +ENV GOOS=linux +ENV GOARCH=amd64 + +COPY go.mod . +COPY go.sum . + +RUN go mod download + +COPY *.go . +COPY . . + +RUN go build ./... && go build + +EXPOSE 8081 + +CMD ["./go-authentication-api"] +