diff --git a/docker-compose.yaml b/docker-compose.yaml index 773955b..43f27e7 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -6,7 +6,7 @@ services: MYSQL_ROOT_PASSWORD: ok ports: - "3306:3306" - - + docs: build: context: . @@ -19,4 +19,14 @@ services: php-api: image: "openml/php-rest-api" ports: - - "8001:80" + - "8002:80" + + python-api: + container_name: "python-api" + build: + context: . + dockerfile: docker/python/Dockerfile + ports: + - "8001:8000" + volumes: + - .:/python-api diff --git a/docker/python/Dockerfile b/docker/python/Dockerfile new file mode 100644 index 0000000..ba1abf9 --- /dev/null +++ b/docker/python/Dockerfile @@ -0,0 +1,14 @@ +FROM python:3.12-bookworm + +RUN apt-get update \ + && apt-get install -y python3-dev default-libmysqlclient-dev build-essential pkg-config + +COPY . /python-api +WORKDIR /python-api + +RUN python -m pip install --upgrade pip +RUN python -m pip install -e ".[dev]" + +EXPOSE 8000 +ENTRYPOINT ["uvicorn"] +CMD ["src.main:app", "--host", "0.0.0.0"]