docker + docker compose + ignore + drone
This commit is contained in:
parent
6c730918ec
commit
c210c4a3c5
35
.dockerignore
Normal file
35
.dockerignore
Normal file
@ -0,0 +1,35 @@
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
|
||||
venv/
|
||||
env/
|
||||
ENV/
|
||||
.venv/
|
||||
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
.DS_Store
|
||||
|
||||
.git/
|
||||
.gitignore
|
||||
.gitattributes
|
||||
|
||||
Dockerfile*
|
||||
docker-compose*.yml
|
||||
.dockerignore
|
||||
|
||||
drone.yml
|
||||
|
||||
tmp/
|
||||
temp/
|
||||
*.tmp
|
||||
|
||||
Thumbs.db
|
||||
.DS_Store
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,3 @@
|
||||
# Python
|
||||
__pycache__/
|
||||
*.pyc
|
||||
*.pyo
|
||||
|
||||
@ -2,10 +2,12 @@ services:
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: lawyer_ai
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
@ -30,17 +32,22 @@ services:
|
||||
backend:
|
||||
build: ./backend
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
POSTGRES_HOST: postgres
|
||||
POSTGRES_PORT: 5432
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: lawyer_ai
|
||||
POSTGRES_PORT: ${POSTGRES_PORT}
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
QDRANT_HOST: qdrant
|
||||
QDRANT_PORT: 6333
|
||||
QDRANT_PORT: ${QDRANT_PORT}
|
||||
REDIS_HOST: redis
|
||||
REDIS_PORT: 6379
|
||||
REDIS_PORT: ${REDIS_PORT}
|
||||
DEBUG: "true"
|
||||
SECRET_KEY: ${SECRET_KEY}
|
||||
APP_NAME: ${APP_NAME}
|
||||
CORS_ORIGINS: ${CORS_ORIGINS}
|
||||
ports:
|
||||
- "8000:8000"
|
||||
depends_on:
|
||||
@ -48,6 +55,26 @@ services:
|
||||
- qdrant
|
||||
- redis
|
||||
|
||||
tg_bot:
|
||||
build: ./tg_bot
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
POSTGRES_HOST: postgres
|
||||
POSTGRES_PORT: ${POSTGRES_PORT}
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
|
||||
DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY}
|
||||
DEEPSEEK_API_URL: ${DEEPSEEK_API_URL:-https://api.deepseek.com/v1/chat/completions}
|
||||
YANDEX_OCR_API_KEY: ${YANDEX_OCR_API_KEY}
|
||||
DEBUG: "true"
|
||||
depends_on:
|
||||
- postgres
|
||||
- backend
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
qdrant_data:
|
||||
|
||||
30
drone.yml
Normal file
30
drone.yml
Normal file
@ -0,0 +1,30 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: deploy-backend
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
- pull_request
|
||||
- tag
|
||||
branch:
|
||||
- main
|
||||
|
||||
steps:
|
||||
- name: deploy-backend
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
from_secret: server_host
|
||||
username:
|
||||
from_secret: server_username
|
||||
password:
|
||||
from_secret: server_password
|
||||
port: 22
|
||||
script:
|
||||
- cd BETTERCALLPRASKOVIA
|
||||
- git pull origin main
|
||||
- docker-compose stop backend tg_bot
|
||||
- docker-compose up --build -d backend tg_bot
|
||||
- docker system prune -f
|
||||
|
||||
18
tg_bot/Dockerfile
Normal file
18
tg_bot/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
postgresql-client \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV PYTHONPATH=/app
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
CMD ["python", "tg_bot/main.py"]
|
||||
Loading…
x
Reference in New Issue
Block a user