# Use this dockerfile to create Cerbos image from binary

FROM alpine:3.15
RUN apk add -U --no-cache ca-certificates && update-ca-certificates
RUN apk --no-cache add curl

EXPOSE 3592 3593
ENV CERBOS_CONFIG="/conf.default.yaml"

RUN curl -L -o cerbos.tar.gz "https://github.com/cerbos/cerbos/releases/download/v0.20.0/cerbos_0.20.0_Linux_x86_64.tar.gz"
RUN tar xvf cerbos.tar.gz
RUN chmod +x cerbos
RUN mv cerbos /cerbos

COPY conf.static.yaml /conf.default.yaml
COPY policies /policies

ENTRYPOINT ["/cerbos"]
CMD ["server"]
HEALTHCHECK --interval=1m --timeout=3s CMD ["/cerbos", "healthcheck"]
