101 lines
1.9 KiB
YAML
101 lines
1.9 KiB
YAML
version: '3.9'
|
|
|
|
services:
|
|
tgbot_app:
|
|
build:
|
|
context: ./tgbot_app
|
|
dockerfile: Dockerfile
|
|
restart: always
|
|
environment:
|
|
- REDIS_HOST=redis
|
|
- DB_HOST=db
|
|
depends_on:
|
|
- redis
|
|
ports:
|
|
- "222:222"
|
|
networks:
|
|
- test-mission_default
|
|
|
|
|
|
redis:
|
|
image: redis
|
|
container_name: redis
|
|
restart: always
|
|
command: redis-server --requirepass ${R_PASSWORD}
|
|
environment:
|
|
- R_PASSWORD=${R_PASSWORD}
|
|
ports:
|
|
- "6379:6379"
|
|
networks:
|
|
- test-mission_default
|
|
|
|
|
|
db:
|
|
image: postgres
|
|
container_name: db
|
|
shm_size: 128mb
|
|
restart: always
|
|
volumes:
|
|
- some_volume:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_USER=${POSTGRES_USER}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
|
- POSTGRES_DB=${POSTGRES_DB}
|
|
ports:
|
|
- "5432:5432"
|
|
networks:
|
|
- test-mission_default
|
|
|
|
|
|
fastapi_app:
|
|
build: ./fastapi_app
|
|
container_name: fastapi_app
|
|
restart: always
|
|
depends_on:
|
|
- db
|
|
ports:
|
|
- "8000:8000"
|
|
networks:
|
|
- test-mission_default
|
|
|
|
|
|
nginx:
|
|
image: nginx
|
|
container_name: my-nginx
|
|
restart: always
|
|
volumes:
|
|
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
|
|
- ./nginx/robots.txt:/var/www/html/robots.txt
|
|
- etc-letsencrypt:/etc/letsencrypt
|
|
- www-html:/var/www/html
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
networks:
|
|
- test-mission_default
|
|
|
|
|
|
certbot:
|
|
image: certbot/certbot
|
|
container_name: certbot
|
|
volumes:
|
|
- etc-letsencrypt:/etc/letsencrypt
|
|
- www-html:/var/www/html
|
|
depends_on:
|
|
- nginx
|
|
command: certonly --webroot -w /var/www/html --email anakinnikitaa@gmail.com -d anakinnikita.ru --cert-name=certfolder --key-type rsa --agree-tos
|
|
ports:
|
|
- "6000:80"
|
|
networks:
|
|
- test-mission_default
|
|
|
|
|
|
volumes:
|
|
some_volume:
|
|
www-html:
|
|
etc-letsencrypt:
|
|
|
|
networks:
|
|
test-mission_default:
|
|
external: true
|