FROM golang:1.14.6-alpine

ARG USER_ID
ARG GROUP_ID

# gcc and musl-dev are required for building go-sqlite3
RUN addgroup --gid ${GROUP_ID} dev && \
    adduser --uid ${USER_ID} -G dev -D dev && \
    apk --no-cache add gcc musl-dev git

RUN mkdir -p /config && chown dev:dev /config

USER dev

VOLUME /config

EXPOSE 9091
