You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
766 B
Docker

FROM golang:1.19-alpine3.16 AS builder
RUN apk -U --no-cache --upgrade --latest add build-base git gcc bash
WORKDIR /go/src/github.com/ory
RUN git clone https://github.com/ory/hydra
WORKDIR /go/src/github.com/ory/hydra
RUN git checkout v2.0.3 -b latest
ENV GO111MODULE on
ENV CGO_ENABLED 1
RUN go mod download
RUN go build -tags json1 -o /usr/bin/hydra
FROM alpine:3.15
RUN addgroup -S ory; \
adduser -S ory -G ory -D -h /home/ory -s /bin/nologin; \
chown -R ory:ory /home/ory
COPY hydra.yml /etc/config/hydra/hydra.yml
COPY --from=builder /usr/bin/hydra /usr/bin/hydra
# Declare the standard ports used by hydra (4444 for public service endpoint, 4445 for admin service endpoint)
EXPOSE 4444 4445
USER ory
ENTRYPOINT ["hydra"]
CMD ["serve"]