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

View File

@ -3,9 +3,8 @@ FROM python:3.13-slim
# Set environment variables # Set environment variables
ENV PYTHONUNBUFFERED=1 ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONDONTWRITEBYTECODE=1
ENV POETRY_NO_INTERACTION=1
ENV POETRY_VENV_IN_PROJECT=1 ENV PYTHONPATH="${PYTHONPATH}:/app/src"
ENV POETRY_CACHE_DIR=/tmp/poetry_cache
# Install system dependencies # Install system dependencies
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
@ -25,7 +24,7 @@ COPY pyproject.toml poetry.lock* ./
# Configure Poetry and install dependencies # Configure Poetry and install dependencies
RUN poetry config virtualenvs.create false \ RUN poetry config virtualenvs.create false \
&& poetry install --only=main --no-dev \ && poetry install --only=main --no-root \
&& rm -rf $POETRY_CACHE_DIR && rm -rf $POETRY_CACHE_DIR
# Copy application code # 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 CMD curl -f http://localhost:8089/ || exit 1
# Run the webhook server # 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