build(oci):加入容器化打包支持。
This commit is contained in:
parent
e1aa45a1d7
commit
64ee9692fe
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@ -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"]
|
@ -1,21 +1,21 @@
|
|||||||
Database:
|
Database:
|
||||||
User: electricity
|
User: electricity
|
||||||
Pass:
|
Pass: nLgxPO5s8gK2tR0OL0Q
|
||||||
Host:
|
Host: postgres
|
||||||
Port: 5432
|
Port: 5432
|
||||||
DB: electricity
|
DB: electricity
|
||||||
MaxIdleConns: 10
|
MaxIdleConns: 10
|
||||||
MaxOpenConns: 30
|
MaxOpenConns: 30
|
||||||
Server:
|
Server:
|
||||||
RunMode: debug
|
RunMode: release
|
||||||
HttpPort: 8000
|
HttpPort: 8000
|
||||||
ReadTimeout: 60
|
ReadTimeout: 60
|
||||||
WriteTimeout: 60
|
WriteTimeout: 60
|
||||||
Redis:
|
Redis:
|
||||||
Host:
|
Host: redis
|
||||||
Port: 6379
|
Port: 6379
|
||||||
Password:
|
Password: TmFRS0w6BIrAPA1Raj
|
||||||
DB: 2
|
DB: 1
|
||||||
Service:
|
Service:
|
||||||
MaxSessionLife: 2h
|
MaxSessionLife: 2h
|
||||||
ItemsPageSize: 20
|
ItemsPageSize: 20
|
||||||
|
Loading…
x
Reference in New Issue
Block a user