FROM python:3.7-alpine

RUN adduser -D testovac

WORKDIR /home/testovac

COPY requirements.txt requirements.txt
RUN python -m venv venv
RUN venv/bin/pip install -r requirements.txt
RUN venv/bin/pip install gunicorn

COPY app app
COPY migrations migrations
COPY testovac.py config.py boot.sh ./
RUN chmod +x boot.sh

ENV FLASK_APP testovac.py

RUN chown -R testovac:testovac ./
USER testovac

EXPOSE 5000
ENTRYPOINT ["./boot.sh"]
