FROM python:3

RUN mkdir -p /app
WORKDIR /app

# Install service runtime requirements
COPY ./requirements-minimal.txt /app/requirements.txt
RUN pip install -r ./requirements.txt

EXPOSE 3000

# Install service as package for alembic
COPY ./fishbowl /app/fishbowl

# Own app dir and drop root
RUN chown -R www-data:www-data /app
USER www-data

# Make data dir
RUN mkdir /app/data
VOLUME /app/data
ENV DB_URI sqlite:////app/data/fishbowl.db

CMD ["python", "/app/fishbowl/app.py"]