init
This commit is contained in:
71
docker-compose.yml
Normal file
71
docker-compose.yml
Normal file
@@ -0,0 +1,71 @@
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
container_name: telegram-llm-chat
|
||||
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||
volumes:
|
||||
- .:/code
|
||||
expose:
|
||||
- "8000"
|
||||
depends_on:
|
||||
- db
|
||||
env_file:
|
||||
- .env
|
||||
|
||||
bot:
|
||||
build: .
|
||||
container_name: telegram-bot
|
||||
command: python bot.py
|
||||
volumes:
|
||||
- .:/code
|
||||
depends_on:
|
||||
- web # бот будет запускаться после backend API
|
||||
env_file:
|
||||
- .env
|
||||
restart: always # если упадёт - перезапустится
|
||||
|
||||
db:
|
||||
image: postgres:15
|
||||
container_name: chatdb
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
volumes:
|
||||
- db-data:/var/lib/postgresql/data
|
||||
|
||||
nginx:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: frontend/Dockerfile
|
||||
container_name: nginx_proxy
|
||||
restart: always
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- certbot-etc:/etc/letsencrypt
|
||||
- certbot-var:/var/lib/letsencrypt
|
||||
- ./nginx/certbot:/var/www/certbot
|
||||
depends_on:
|
||||
- web
|
||||
|
||||
certbot:
|
||||
image: certbot/certbot
|
||||
container_name: certbot
|
||||
volumes:
|
||||
- certbot-etc:/etc/letsencrypt
|
||||
- certbot-var:/var/lib/letsencrypt
|
||||
- ./nginx/certbot:/var/www/certbot
|
||||
depends_on:
|
||||
- nginx
|
||||
# Закоментируй entrypoint для первого выпуска сертификата!!!
|
||||
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew --webroot -w /var/www/certbot; sleep 12h; done'"
|
||||
|
||||
volumes:
|
||||
db-data:
|
||||
certbot-etc:
|
||||
certbot-var:
|
||||
frontend-html:
|
||||
Reference in New Issue
Block a user