-
Notifications
You must be signed in to change notification settings - Fork 409
/
Copy pathDockerfile
32 lines (24 loc) · 1.15 KB
/
Dockerfile
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
ARG VERSION
ARG COMMIT
FROM golang:1.19.1 AS build
WORKDIR /src
ADD . .
ENV CGO_ENABLED=1
# split into several commands for better logging on GitHub Actions
RUN go mod download
RUN go build -v -o=bin/ferretdb -trimpath -tags=ferretdb_testcover,ferretdb_tigris -race ./cmd/ferretdb
RUN go test -c -o=bin/ferretdb -trimpath -tags=ferretdb_testcover,ferretdb_tigris -race -coverpkg=./... ./cmd/ferretdb
FROM golang:1.19.1
COPY --from=build /src/bin/ferretdb /ferretdb
EXPOSE 27017
ENTRYPOINT [ "/ferretdb" ]
CMD [ "-listen-addr=:27017", "-postgresql-url=postgres://username:password@hostname:5432/ferretdb" ]
# https://github.com/opencontainers/image-spec/blob/main/annotations.md
LABEL org.opencontainers.image.description="A truly Open Source MongoDB alternative"
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.revision="${COMMIT}"
LABEL org.opencontainers.image.source="https://github.com/FerretDB/FerretDB"
LABEL org.opencontainers.image.title="FerretDB"
LABEL org.opencontainers.image.url="https://ferretdb.io/"
LABEL org.opencontainers.image.vendor="FerretDB Inc."
LABEL org.opencontainers.image.version="${VERSION}"