FROM golang:1.13-alpine

#TODO(nightah): Remove when turning off Travis
ARG TRAVIS
RUN if [ "$TRAVIS" == "true" ]; then apk --no-cache add gcc musl-dev; fi
#TODO(nightah): Remove when turning off Travis

ARG USER_ID
ARG GROUP_ID

RUN addgroup --gid ${GROUP_ID} dev && \
    adduser --uid ${USER_ID} -G dev -D dev

RUN mkdir -p /etc/authelia && chown dev:dev /etc/authelia
RUN mkdir -p /var/lib/authelia && chown dev:dev /var/lib/authelia

USER dev

VOLUME /etc/authelia
VOLUME /var/lib/authelia