kopia lustrzana https://github.com/reiver/greatape
feat(project): ✨ update Dockerfile
rodzic
770107b54b
commit
fe24617a85
|
@ -25,7 +25,6 @@
|
|||
go.work
|
||||
|
||||
### Go Patch ###
|
||||
/vendor/
|
||||
/Godeps/
|
||||
|
||||
### GoLand+all ###
|
||||
|
|
23
Dockerfile
23
Dockerfile
|
@ -1,18 +1,29 @@
|
|||
FROM golang:1.19 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
WORKDIR /src
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build -a -ldflags '-linkmode external -extldflags "-static"' -o ./bin/greatape .
|
||||
RUN CGO_ENABLED=1 GOOS=linux go build \
|
||||
-ldflags '-linkmode external -extldflags "-static" -X github.com/reiver/greatape/components/core.runningInContainer=true -w -s' \
|
||||
-a -o ./bin/greatape .
|
||||
|
||||
FROM scratch
|
||||
|
||||
ENV PROTOCOL="http"
|
||||
ENV DOMAIN="localhost"
|
||||
ENV PORT=80
|
||||
# development, staging, production
|
||||
ENV ENVIRONMENT=development
|
||||
|
||||
COPY --from=builder /app/bin /app
|
||||
ENV PROTOCOL=https
|
||||
ENV FQDN=yourdomain.com
|
||||
ENV PORT=7080
|
||||
|
||||
ENV POSTGRES_HOST=127.0.0.1
|
||||
ENV POSTGRES_PORT=5432
|
||||
ENV POSTGRES_DATABASE=greatape
|
||||
ENV POSTGRES_USER=postgres
|
||||
ENV POSTGRES_PASSWORD=password
|
||||
|
||||
COPY --from=builder /src/bin /app
|
||||
|
||||
EXPOSE $PORT
|
||||
|
||||
|
|
2
go.mod
2
go.mod
|
@ -5,7 +5,7 @@ go 1.19
|
|||
require (
|
||||
github.com/robfig/cron v1.2.0
|
||||
github.com/sendgrid/sendgrid-go v3.12.0+incompatible
|
||||
github.com/xeronith/diamante v1.7.4
|
||||
github.com/xeronith/diamante v1.7.8
|
||||
google.golang.org/protobuf v1.28.1
|
||||
)
|
||||
|
||||
|
|
4
go.sum
4
go.sum
|
@ -45,8 +45,8 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC
|
|||
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||
github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
|
||||
github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||
github.com/xeronith/diamante v1.7.4 h1:V7llhK1fFt4jNH3t4OsEBx3vMCk27cQ3BWqPl2DekAg=
|
||||
github.com/xeronith/diamante v1.7.4/go.mod h1:9Tm1tILSKRFRLqvGkG6fTNdLpQbsTZohTLD6xRoWkx8=
|
||||
github.com/xeronith/diamante v1.7.8 h1:Mx6nXm3eqYo79dD3D0SoX/aSYa/23QSYGrVXwQdEuok=
|
||||
github.com/xeronith/diamante v1.7.8/go.mod h1:9Tm1tILSKRFRLqvGkG6fTNdLpQbsTZohTLD6xRoWkx8=
|
||||
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
|
||||
|
|
Ładowanie…
Reference in New Issue