feat: initial commit

This commit is contained in:
 Ilya Atamas
2019-04-16 15:05:21 +03:00
commit 4dad509dc6
11 changed files with 307 additions and 0 deletions

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
# === BUILD STAGE === #
FROM golang:1.12-alpine as build
ARG ACCESS_TOKEN
RUN apk add --no-cache git
WORKDIR /srv/app
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go test -v ./...
RUN go build -ldflags="-w -s" -o build
# === RUN STAGE === #
FROM scratch as run
WORKDIR /srv/app
COPY --from=build /srv/app/build /srv/app/build
ENV LISTEN_ADDRESS 0.0.0.0:8080
ENV GIN_MODE release
CMD ["/srv/app/build"]