diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..1a2222eb52c5ab705a5dfb0bc3f7c18768ee9219 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,16 @@ +.DS_Store + +/venv/ +__pycache__ +*.pyc + +*.html +*.json +*.xml +*.zip + +*.txt +!/requirements.txt + +.env* +!/.env.example diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..019d55b64abd6d204b0d73818d2cd52f4fb92af3 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,24 @@ +stages: + - deploy + +deploy: + image: docker + services: + - "docker:dind" + tags: + - dind + stage: deploy + only: + - main + - master + + before_script: + - echo "$CI_REGISTRY_PASSWORD" | docker login $CI_REGISTRY -u $CI_REGISTRY_USER --password-stdin + + script: + - docker build --cache-from $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA . + - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA + - docker push $CI_REGISTRY_IMAGE:latest + + after_script: + - docker logout $CI_REGISTRY diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..926045b6adb4509d91b1509ae9b07520f44a1923 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM python:3.13-alpine + +WORKDIR /app +COPY ./requirements.txt /app + +RUN pip install -r requirements.txt + +COPY . /app + +ENTRYPOINT ["python"] +CMD ["push_to_db.py"]