FROM alpine:3.7
LABEL mantainer="robert.gauto@gmail.com"

ENV VERSION="2.5.0"

RUN set -x; \
	apk update && \
	apk upgrade && \
	apk add --no-cache --update python3 && \
	apk add --virtual --update musl-dev postgresql-dev python3-dev gcc && \
	wget -O- https://github.com/OmniDB/OmniDB/archive/${VERSION}.tar.gz | tar xvz && \
	cd OmniDB-${VERSION} && \
	pip3 install -r requirements.txt && \
	apk del musl-dev

WORKDIR OmniDB-${VERSION}/OmniDB

EXPOSE 8000
CMD ["/usr/bin/python3", "manage.py", "runserver", "0.0.0.0:8000"]
