This commit is contained in:
Ivanov Matvey 2025-01-24 19:36:32 +10:00
parent c0f7b030a6
commit 77b3cb5d72
10 changed files with 81 additions and 9 deletions

33
api/.dockerignore Normal file
View File

@ -0,0 +1,33 @@
# python generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info
# venv
.venv
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# ruff
.ruff_cache/
# rye
requirements-dev.lock
# alembic migrations
alembic/versions
# Docker compose
compose.yaml
# minio
minio
# env (pass it thru compose)
.env

View File

@ -1,9 +1,9 @@
FROM python:3.12 FROM python:3.12
WORKDIR /src WORKDIR /api
RUN apt-get update && apt-get install make RUN apt-get update && apt-get install make
COPY Makefile requirements.lock pyproject.toml README.md /src/ COPY Makefile requirements.lock pyproject.toml README.md /api/
RUN make deps RUN make deps
COPY . . COPY . .

View File

@ -1,3 +1,6 @@
deps: deps:
pip install uv pip install uv
uv pip install --no-cache --system -r requirements.lock uv pip install --no-cache --system -r requirements.lock
run:
fastapi run src/app.py --host 0.0.0.0

View File

@ -33,8 +33,8 @@ class DeviceProperties(BaseModel):
estPurchaseDate: Optional[int] = None estPurchaseDate: Optional[int] = None
simLock: Optional[bool] = None # parameter is exist only in documentation simLock: Optional[bool] = None # parameter is exist only in documentation
warrantyStatus: Optional[str] = None warrantyStatus: Optional[str] = None
repairCoverage: Union[bool, str] # I got bool, in documentation - str repairCoverage: Union[bool, str, None] = None # I got bool, in documentation - str
technicalSupport: Union[bool, str] # I got bool, in documentation - str technicalSupport: Union[bool, str, None] = None # I got bool, in documentation - str
replacement: Optional[bool] = None # parameter isn't exist in documentation replacement: Optional[bool] = None # parameter isn't exist in documentation
demoUnit: Optional[bool] = None demoUnit: Optional[bool] = None
refurbished: Optional[bool] = None refurbished: Optional[bool] = None

33
bot/.dockerignore Normal file
View File

@ -0,0 +1,33 @@
# python generated files
__pycache__/
*.py[oc]
build/
dist/
wheels/
*.egg-info
# venv
.venv
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# ruff
.ruff_cache/
# rye
requirements-dev.lock
# alembic migrations
alembic/versions
# Docker compose
compose.yaml
# minio
minio
# env (pass it thru compose)
.env

View File

@ -1,9 +1,9 @@
FROM python:3.12 FROM python:3.12
WORKDIR /src WORKDIR /bot
RUN apt-get update && apt-get install make RUN apt-get update && apt-get install make
COPY Makefile requirements.lock pyproject.toml README.md /src/ COPY Makefile requirements.lock pyproject.toml README.md /bot/
RUN make deps RUN make deps
COPY . . COPY . .

View File

@ -1,3 +1,6 @@
deps: deps:
pip install uv pip install uv
uv pip install --no-cache --system -r requirements.lock uv pip install --no-cache --system -r requirements.lock
run:
python main.py

View File

@ -13,7 +13,7 @@ dependencies = [
"requests>=2.32.3", "requests>=2.32.3",
] ]
readme = "README.md" readme = "README.md"
requires-python = ">= 3.8" requires-python = ">= 3.12"
[build-system] [build-system]
requires = ["hatchling"] requires = ["hatchling"]
@ -27,4 +27,4 @@ dev-dependencies = []
allow-direct-references = true allow-direct-references = true
[tool.hatch.build.targets.wheel] [tool.hatch.build.targets.wheel]
packages = ["src"] packages = ["src/bot"]

View File

@ -12,7 +12,7 @@ services:
start_period: 1s start_period: 1s
timeout: 600s timeout: 600s
ports: ports:
- 8000:8000 - 8005:8000
bot: bot:
container_name: hatiko-bot container_name: hatiko-bot