FROM python:alpine

RUN apk add --no-cache \
        gcc musl-dev \
        mysql mariadb-connector-c-dev && \
    mkdir /opt/code

COPY requirements.txt /opt/code/requirements.txt
WORKDIR /opt/code

RUN pip install -r requirements.txt

USER nobody

COPY . /opt/code

CMD [ "/bin/sh", "docker-entry.sh" ]