Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edmartt/misc/add dockerfile #7

Merged
merged 2 commits into from
May 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

2 changes: 1 addition & 1 deletion internal/users/data/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}

Expand Down