From 7ba5dadfa0bddb9b29e31613d07acac3cde92951 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Fri, 9 Aug 2024 19:28:41 +0200 Subject: [PATCH] chore: add `docker-compose.yml` to run tests --- docker-compose.yml | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 docker-compose.yml diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..77492576 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,52 @@ +version: '3.8' + +services: + app: + image: python:3.9-slim + container_name: python_sdk_app_container + working_dir: /app + volumes: + - .:/app + - python_packages:/usr/local/lib/python3.9/site-packages + depends_on: + - install_deps + command: python ./run_checks.py + + install_deps: + image: python:3.9-slim + container_name: python_sdk_install_deps_container + working_dir: /app + volumes: + - .:/app + - .cache/pip:/root/.cache/pip + - python_packages:/usr/local/lib/python3.9/site-packages + command: pip install --no-cache-dir -r requirements.txt + + install_test_deps: + image: python:3.9-slim + container_name: python_sdk_install_test_deps_container + working_dir: /app + volumes: + - .:/app + - .cache/pip:/root/.cache/pip + - python_packages:/usr/local/lib/python3.9/site-packages + depends_on: + - install_deps + command: pip install --no-cache-dir -r test-requirements.txt + + test: + image: python:3.9-slim + container_name: python_sdk_test_container + working_dir: /app + volumes: + - .:/app + - python_packages:/usr/local/lib/python3.9/site-packages + depends_on: + - install_test_deps + command: python -m pytest + env_file: + - .env + +volumes: + python_packages: +