контейнеризация для dev
This commit is contained in:
parent
1e9fa1f702
commit
bece7ab23b
4 changed files with 50 additions and 0 deletions
8
.dockerignore
Normal file
8
.dockerignore
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
.venv/
|
||||
.git/
|
||||
.idea/
|
||||
.pytest_cache/
|
||||
.ruff_cache/
|
||||
*.md
|
||||
*.pyc
|
||||
__pycache__/
|
||||
4
.env.example
Normal file
4
.env.example
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
PROVIDER_URL=http://localhost:8000/v1
|
||||
PROVIDER_API_KEY=your-api-key
|
||||
PROVIDER_MODEL=gpt-4
|
||||
AGENT_API_PATH=../agent_api
|
||||
22
Dockerfile
Normal file
22
Dockerfile
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
FROM python:3.14-slim as base
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
FROM base as development
|
||||
|
||||
RUN pip install uv
|
||||
|
||||
COPY pyproject.toml uv.lock ./
|
||||
RUN uv sync --frozen --no-install-project
|
||||
|
||||
COPY --from=agent_api . /agent_api/
|
||||
RUN uv pip install -e /agent_api/
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|
||||
16
docker-compose.yml
Normal file
16
docker-compose.yml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
services:
|
||||
agent-dev:
|
||||
build:
|
||||
context: .
|
||||
target: development
|
||||
additional_contexts:
|
||||
agent_api: ${AGENT_API_PATH}
|
||||
volumes:
|
||||
- ./src:/app/src
|
||||
- ${AGENT_API_PATH}:/agent-api/
|
||||
ports:
|
||||
- "8000:8000"
|
||||
env_file:
|
||||
- .env
|
||||
profiles:
|
||||
- dev
|
||||
Loading…
Add table
Add a link
Reference in a new issue