-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (41 loc) · 1.45 KB
/
Dockerfile
File metadata and controls
56 lines (41 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM golang:1.18 AS build-env
WORKDIR /go/src/app
COPY go.mod .
COPY main.go .
COPY app ./app
COPY helpers ./helpers
COPY services ./services
COPY middlewares ./middlewares
ENV CGO_ENABLED=0
ENV GO111MODULE=on
RUN go get -d -v ./...
RUN go mod tidy
RUN go vet -v
RUN go test -v
RUN go build -o /go/bin/app
# We don't use /base because we don't need OpenSSL, libSSL and glibc
FROM gcr.io/distroless/static
ARG CI_NAME=local
ENV CI_NAME=${CI_NAME}
ARG CI_VERSION=none
ENV CI_VERSION=${CI_VERSION}
ARG SCM_REF=none
ENV SCM_REF=${SCM_REF}
ARG BUILD_DATE=none
ENV BUILD_DATE=${BUILD_DATE}
LABEL org.opencontainers.image.title="ReGraphQL"
LABEL org.opencontainers.image.created="${BUILD_DATE}"
LABEL org.opencontainers.image.description="A simple (yet effective) REST / HTTP to GraphQL router"
LABEL org.opencontainers.image.authors="ezequiel.aceto+regraphql@gmail.com"
LABEL org.opencontainers.image.url="https://hub.docker.com/repository/docker/eaceto/regraphql"
LABEL org.opencontainers.image.source="https://github.com/eaceto/ReGraphQL"
LABEL org.opencontainers.image.version="1.0.1"
LABEL dev.eaceto.regraphql.image.ci.name="${CI_NAME}"
LABEL dev.eaceto.regraphql.image.scm.ref="${SCM_REF}"
LABEL dev.eaceto.regraphql.image.ci.version="${CI_VERSION}"
LABEL dev.eaceto.regraphql.health="http://localhost:8080/health/liveness"
COPY --from=build-env /go/bin/app /
EXPOSE 8080
HEALTHCHECK CMD curl --fail http://localhost:8080/health/liveness || exit 1
USER 1000
CMD ["/app"]