FROM alpine:latest

ENV REPOFILE="/etc/customMirrors/repoList.list" EXTRAURL="http://mdu.se/"
ENV DNSSRV="1.1.1.1"
ENV IPV4FILENAME="MirrorListV4" IPV6FILENAME="MirrorListV6"
ENV CRONTABSET="25 */4 * * *"


RUN apk update && \
    apk add python3 py3-pip git bash

RUN mkdir /etc/customMirrors
WORKDIR /etc/customMirrors/

COPY mainDocker.py .
COPY whatDomain.py .
COPY requirements.txt .
COPY init.sh .

RUN python3 -m venv venv && \
    venv/bin/python3 -m pip install --upgrade pip && \
    venv/bin/pip3 install -r requirements.txt

COPY gitPush.sh .

RUN chmod +x ./gitPush.sh

CMD ["bash", "init.sh"]
