diff --git a/Dockerfile b/Dockerfile index 7d33eb9..6c0e931 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,18 +8,22 @@ ENV POETRY_CACHE_DIR=/opt/.cache # Install poetry separated from system interpreter RUN python3 -m venv $POETRY_VENV \ - && $POETRY_VENV/bin/pip install -U pip setuptools \ - && $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION} + && $POETRY_VENV/bin/pip install -U pip setuptools \ + && $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION} # Add `poetry` to PATH ENV PATH="${PATH}:${POETRY_VENV}/bin" -WORKDIR /app +ENV WORKING_DIR=/app + +# Set the working directory to /app +WORKDIR ${WORKING_DIR} + +# Copy the project to the container +COPY . ${WORKING_DIR} +# COPY .env ${WORKING_DIR} +COPY pyproject.toml . -# Install dependencies -COPY poetry.lock pyproject.toml ./ RUN poetry install -# Run your app -COPY . /app -CMD [ "poetry", "run", "python", "uvicorn app.main:app --reload" ] \ No newline at end of file +CMD poetry run uvicorn app.main:app --host 0.0.0.0 --port 80 \ No newline at end of file diff --git a/compose.yml b/compose.yml index e69de29..cebb4a1 100644 --- a/compose.yml +++ b/compose.yml @@ -0,0 +1,8 @@ +services: + web: + build: + dockerfile: Dockerfile + environment: + - WEBHOOK='https://crm.svs-tech.pro/rest/1/liljl5r1k6dtxt0s/' + ports: + - 8099:80 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 6222fa7..c5e1c2e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,13 +4,13 @@ version = "0.1.0" description = "" authors = ["aarizona "] readme = "README.md" -package-mode = false [tool.poetry.dependencies] python = "^3.10" fastapi = "^0.110.3" uvicorn = "^0.29.0" python-dotenv = "^1.0.1" +requests = "^2.31.0" [tool.poetry.group.dev.dependencies] diff --git a/readme.md b/readme.md index 46d29e0..45955d1 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,7 @@ # gitea webhook fastapi app -## start -+ `poetry run task app` \ No newline at end of file +## dev ++ `poetry run task app` + +## server ++ `docker compose up -d` \ No newline at end of file