From 92896306532f5dc9f0c8b57abbc7ec38237c3313 Mon Sep 17 00:00:00 2001 From: Joaquin Sargiotto Date: Fri, 7 Jul 2023 13:08:07 +0200 Subject: [PATCH 1/2] Update docker image Use newer python base image and update dependencies. --- Dockerfile | 2 +- requirements.txt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 99b207d..d338dc4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM scrapinghub/python:3 +FROM python:3.11-slim EXPOSE 5000 WORKDIR /app CMD ["/app/start-spidyquotes"] diff --git a/requirements.txt b/requirements.txt index eb100bf..b946aa7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Flask==1.0 -Flask-Limiter==0.8.5 -gunicorn==19.6.0 -awesome-slugify==1.6.5 \ No newline at end of file +Flask==2.3.2 +Flask-Limiter==3.3.1 +gunicorn==20.1.0 +awesome-slugify==1.6.5 From 3d58145e534b46bc75e34460177fee17d9c4a4eb Mon Sep 17 00:00:00 2001 From: Joaquin Sargiotto Date: Fri, 7 Jul 2023 13:15:10 +0200 Subject: [PATCH 2/2] Build docker image using CircleCI --- .circleci/config.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..22ab54c --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,36 @@ +version: 2 + +jobs: + build-and-publish: + docker: + - image: cimg/python:3.10 + + steps: + - checkout + + - setup_remote_docker: + docker_layer_caching: true + + - run: + name: Publish Docker image + command: | + # Build image + docker build \ + -t ${DOCKER_REPO}/spidyquotes/${CIRCLE_BRANCH,,}:${CIRCLE_SHA1:0:7} \ + . + + # Docker login + docker login \ + -u ${DOCKER_USER} \ + -p ${DOCKER_PASS} \ + ${DOCKER_REPO} + + # Push image + docker push \ + ${DOCKER_REPO}/spidyquotes/${CIRCLE_BRANCH,,}:${CIRCLE_SHA1:0:7} + +workflows: + version: 2 + build-and-publish-workflow: + jobs: + - build-and-publish