Added Scratch Build
This commit is contained in:
parent
bcfc91226f
commit
78d77e514c
2 changed files with 10 additions and 6 deletions
14
Dockerfile
14
Dockerfile
|
@ -1,11 +1,15 @@
|
|||
FROM golang:alpine
|
||||
FROM golang:alpine as builder
|
||||
|
||||
WORKDIR /go/src/git.ucode.space/goshortly
|
||||
RUN apk add --no-cache gcc libgo
|
||||
|
||||
WORKDIR /go/src/git.ucode.space/goshorly
|
||||
COPY . .
|
||||
|
||||
RUN apk add gcc libgo
|
||||
|
||||
RUN go get -d -v ./...
|
||||
RUN go build -o app .
|
||||
|
||||
CMD ["go", "run", "main.go"]
|
||||
FROM scratch as production
|
||||
|
||||
WORKDIR /goshorly
|
||||
COPY --from=builder /go/src/git.ucode.space/goshorly/app .
|
||||
CMD ["./app"]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
version: "3"
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
|
|
Loading…
Reference in a new issue