From f869acdb18c3614870edda3b20da9e6bcf21576a Mon Sep 17 00:00:00 2001 From: sushi-chaaaan Date: Mon, 13 May 2024 13:30:25 +0900 Subject: [PATCH] fix(directory): handle directory structure change by #56 --- Dockerfile => api/Dockerfile | 4 ++-- api/README.md | 2 ++ api/pyproject.toml | 8 ++++---- compose.yml | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) rename Dockerfile => api/Dockerfile (83%) create mode 100644 api/README.md diff --git a/Dockerfile b/api/Dockerfile similarity index 83% rename from Dockerfile rename to api/Dockerfile index 85fcd32..706cda4 100644 --- a/Dockerfile +++ b/api/Dockerfile @@ -11,7 +11,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 COPY pyproject.toml README.md ./ -COPY birdxplorer/__init__.py ./birdxplorer/ +COPY birdxplorer_api/__init__.py ./birdxplorer_api/ RUN pip install --no-cache-dir -e ".[${ENVIRONMENT}]" FROM python:${PYTHON_VERSION_CODE}-slim-bookworm as runner @@ -26,4 +26,4 @@ USER app COPY --from=builder /usr/local/lib/python${PYTHON_VERSION_CODE}/site-packages /usr/local/lib/python${PYTHON_VERSION_CODE}/site-packages COPY --chown=app:app . ./ -ENTRYPOINT ["python", "-m", "uvicorn", "birdxplorer.main:app", "--host", "0.0.0.0"] +ENTRYPOINT ["python", "-m", "uvicorn", "birdxplorer_api.main:app", "--host", "0.0.0.0"] diff --git a/api/README.md b/api/README.md new file mode 100644 index 0000000..281ffc7 --- /dev/null +++ b/api/README.md @@ -0,0 +1,2 @@ + +# BirdXplorer API diff --git a/api/pyproject.toml b/api/pyproject.toml index 7503043..3079e78 100644 --- a/api/pyproject.toml +++ b/api/pyproject.toml @@ -10,9 +10,9 @@ authors = [ {name = "osoken"}, ] dynamic = [ - "version", + "version", ] -readme = "../README.md" +readme = "README.md" license = {file = "../LICENSE"} requires-python = ">=3.10" @@ -100,11 +100,11 @@ legacy_tox_ini = """ envlist = py310 [testenv] - setenv = + setenv = VIRTUALENV_PIP = 24.0 deps = -e .[dev] - commands = + commands = black birdxplorer_api tests isort birdxplorer_api tests pytest diff --git a/compose.yml b/compose.yml index 74ffeaf..bbdc435 100644 --- a/compose.yml +++ b/compose.yml @@ -18,7 +18,7 @@ services: build: args: - ENVIRONMENT=dev - context: . + context: ./api dockerfile: Dockerfile env_file: - .env