diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f758324 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:1.19-alpine AS builder + +ENV GO111MODULE=on +ENV GOPROXY="https://goproxy.io" +RUN mkdir /app +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download && go mod verify +ADD . /app +RUN CGO_ENABLED=0 GOOS=linux go build -v -o server . + +FROM alpine:latest AS production +RUN mkdir /app +WORKDIR /app +COPY --from=builder /app/server . +COPY settings.yaml . +CMD ["./main"] \ No newline at end of file diff --git a/settings.yaml b/settings.yaml index 39eaa8f..d68ea41 100644 --- a/settings.yaml +++ b/settings.yaml @@ -1,21 +1,21 @@ Database: User: electricity - Pass: - Host: + Pass: nLgxPO5s8gK2tR0OL0Q + Host: postgres Port: 5432 DB: electricity MaxIdleConns: 10 MaxOpenConns: 30 Server: - RunMode: debug + RunMode: release HttpPort: 8000 ReadTimeout: 60 WriteTimeout: 60 Redis: - Host: + Host: redis Port: 6379 - Password: - DB: 2 + Password: TmFRS0w6BIrAPA1Raj + DB: 1 Service: MaxSessionLife: 2h ItemsPageSize: 20