diff --git a/docker/DependencyDockerfile b/docker/DependencyDockerfile new file mode 100644 index 0000000..769c367 --- /dev/null +++ b/docker/DependencyDockerfile @@ -0,0 +1,3 @@ +FROM python:3.9.17 +COPY . /digits/ +RUN pip3 install --no-cache-dir -r /digits/requirements.txt diff --git a/docker/FinalDockerfile b/docker/FinalDockerfile new file mode 100644 index 0000000..0dc34a5 --- /dev/null +++ b/docker/FinalDockerfile @@ -0,0 +1,5 @@ +FROM base:latest + +WORKDIR /digits +ENV FLASK_APP=api/app +CMD [ "python3", "-m" , "pytest"] diff --git a/docker/docker_push_helper.sh b/docker/docker_push_helper.sh new file mode 100644 index 0000000..608ff4f --- /dev/null +++ b/docker/docker_push_helper.sh @@ -0,0 +1,3 @@ +az login --scope https://management.core.windows.net//.default +az acr build --file ./docker/DependencyDockerfile --registry M23CSA018 --image base . +az acr build --file ./docker/FinalDockerfile --registry M23CSA018 --image digits . \ No newline at end of file diff --git a/docker/docker_run.sh b/docker/docker_run.sh index 26d7817..1fbfb17 100644 --- a/docker/docker_run.sh +++ b/docker/docker_run.sh @@ -1,7 +1,10 @@ # Build the docker file -docker build -t digits:v1 -f ./docker/Dockerfile . -# Create out volume -docker volume create mltrain -# Mount our volume to models directory (where train data is stored) -docker run -d -p 80:5000 -v mltrain:/digits/models digits:v1 +docker build -t base:latest -f ./docker/DependencyDockerfile . +docker build -t digits:latest -f ./docker/FinalDockerfile . +docker run digits:latest + +# # Create out volume +# docker volume create mltrain +# # Mount our volume to models directory (where train data is stored) +# docker run -d -p 80:5000 -v mltrain:/digits/models digits:v1