Compare commits

...

2 Commits

Author SHA1 Message Date
aarizona 6ec38ac388 docker 2024-05-02 14:08:11 +03:00
aarizona 1b6de48357 base docker 2024-05-02 13:33:55 +03:00
4 changed files with 43 additions and 3 deletions

29
Dockerfile Normal file
View File

@ -0,0 +1,29 @@
FROM python:3.10
# Configure Poetry
ENV POETRY_VERSION=1.2.0
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
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}
# Add `poetry` to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"
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 .
RUN poetry install
CMD poetry run uvicorn app.main:app --host 0.0.0.0 --port 80

8
compose.yml Normal file
View File

@ -0,0 +1,8 @@
services:
web:
build:
dockerfile: Dockerfile
environment:
- WEBHOOK='https://crm.svs-tech.pro/rest/1/liljl5r1k6dtxt0s/'
ports:
- 8099:80

View File

@ -4,13 +4,13 @@ version = "0.1.0"
description = ""
authors = ["aarizona <ar.ariz.arizona@gmail.com>"]
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]

View File

@ -1,4 +1,7 @@
# gitea webhook fastapi app
## start
+ `poetry run task app`
## dev
+ `poetry run task app`
## server
+ `docker compose up -d`