oralo@helpful-question:~/WebOralia2$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f72a91c11dba bot "python3 main.py" 52 seconds ago Up 50 seconds 8001/tcp bot2
3d353ea42874 weboralia2_web "/usr/src/app/deploy…" 3 weeks ago Up 18 hours web
972da8378e75 weboralia2_celery-worker "/usr/src/app/deploy…" 3 weeks ago Up 18 hours celery-worker
89363d8c3508 weboralia2_postgres "docker-entrypoint.s…" 3 weeks ago Up 18 hours 5432/tcp postgres
b692d7ce80b0 redis:alpine "docker-entrypoint.s…" 3 weeks ago Up 18 hours 6379/tcp redis
NETWORK ID NAME DRIVER SCOPE
539bf59f1558 bridge bridge local
aac92cbfa8e5 host host local
bfa45a935a36 none null local
19bb7f74bc45 weboralia2_default bridge local
oralo@helpful-question:~/WebOralia2$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
cae2ee31e399 bot "python3 main.py" 16 seconds ago Up 16 seconds 8001/tcp bot
Attaching to nginx
nginx | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
nginx | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
nginx | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
nginx | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
nginx | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
nginx | /docker-entrypoint.sh: Configuration complete; ready for start up
nginx | 2023/01/08 09:44:31 [emerg] 1#1: host not found in upstream "bot:8001" in /etc/nginx/conf.d/nginx.conf:6
nginx | nginx: [emerg] host not found in upstream "bot:8001" in /etc/nginx/conf.d/nginx.conf:6
oralo@helpful-question:~/WebOralia2$ cat docker/nginx/nginx.conf
upstream web {
server web:8000;
}
upstream bot{
server bot:8001;
}
server {
listen 80;
server_name www.0ralo.site 0ralo.site;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://0ralo.ru$request_uri;
}
}
server {
listen 443 ssl;
client_max_body_size 20M;
server_name 0ralo.ru;
ssl_certificate /etc/letsencrypt/live/0ralo.ru/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/0ralo.ru/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_pass http://web;
proxy_redirect off;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /static/ {
alias /static/;
}
location /media/ {
autoindex on;
alias /media/;
}
location /webhook {
proxy_pass http://bot/;
}
}