diff --git a/Dockerfile b/Dockerfile index 2e49e42..7f4daba 100644 --- a/Dockerfile +++ b/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"] \ No newline at end of file +FROM scratch as production + +WORKDIR /goshorly +COPY --from=builder /go/src/git.ucode.space/goshorly/app . +CMD ["./app"] diff --git a/docker-compose.yml b/docker-compose.yml index 81295f0..ac50387 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: "3" services: web: - build: . + build: . ports: - "3000:3000" depends_on: