update creation of docker containers

This commit is contained in:
oleg.vodyanov91@gmail.com 2025-09-14 22:50:37 +04:00
parent 22bcc814e1
commit 97bf38f0c0
3 changed files with 13 additions and 8 deletions

View File

@ -7,8 +7,6 @@ services:
volumes:
- db_data:/var/lib/postgresql/data
- ./db/init:/docker-entrypoint-initdb.d:ro
ports:
- 5432:5432
networks:
- docbot-network
healthcheck:
@ -16,6 +14,11 @@ services:
interval: 10s
timeout: 5s
retries: 5
hostname: postgres
container_name: db
profiles:
- production
- development
chat:
build:
context: .
@ -37,6 +40,8 @@ services:
condition: service_healthy
networks:
- docbot-network
hostname: chatbot
container_name: chatbot
profiles:
- production
- development
@ -53,12 +58,13 @@ services:
- LOGGING_LEVEL=${LOGGING_LEVEL:-INFO}
- PRODAMUS_TOKEN=${PRODAMUS_TOKEN}
ports:
- "8000:8089"
- "127.0.0.1:8089:8089"
depends_on:
db:
condition: service_healthy
networks:
- docbot-network
container_name: webhook
profiles:
- production
- development

View File

@ -3,9 +3,8 @@ FROM python:3.13-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV POETRY_NO_INTERACTION=1
ENV POETRY_VENV_IN_PROJECT=1
ENV POETRY_CACHE_DIR=/tmp/poetry_cache
ENV PYTHONPATH="${PYTHONPATH}:/app/src"
# Install system dependencies
RUN apt-get update && apt-get install -y \
@ -25,7 +24,7 @@ COPY pyproject.toml poetry.lock* ./
# Configure Poetry and install dependencies
RUN poetry config virtualenvs.create false \
&& poetry install --only=main --no-dev \
&& poetry install --only=main --no-root \
&& rm -rf $POETRY_CACHE_DIR
# Copy application code
@ -44,4 +43,4 @@ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8089/ || exit 1
# Run the webhook server
CMD ["uvicorn", "webhook.main:app", "--host", "0.0.0.0", "--port", "8089"]
CMD ["uvicorn", "webhook.main:app", "--app-dir", "/app/src", "--host", "0.0.0.0", "--port", "8089"]

0
src/webhook/__init__.py Normal file
View File