我试图在同一服务器上的不同 ip 下的 django 上运行两个站点,出现端口繁忙的错误,我修复了端口,但站点无法启动。请告诉我错误在哪里?IP 工作,当我转到第二个 IP 时,我会重定向到第一个站点。所有设置都是为第二个站点指定的。最后,我添加了第一个站点的nginx设置
这是第二个 docker-compose 文件及其设置。我将非常感谢你的帮助
.env
#Django
# Should be one of dev, prod
MODE=prod
PORT=8008
#postgres
DB_NAME=xxx
DB_USER=xxx
DB_HOST=xxx
DB_PASSWORD=xxxx
DB_PORT=5432
POSTGRES_PASSWORD=mysecretpassword
#WSGI
WSGI_PORT=8008
WSGI_WORKERS=4
WSGI_LOG_LEVEL=debug
# Celery
CELERY_NUM_WORKERS=2
# Email
EMAIL_HOST_USER=xxxx
EMAIL_HOST_PASSWORD=xxxx
Run Code Online (Sandbox Code Playgroud)
docker-compose.yml
version: '3'
services:
backend:
build: ./
container_name: site_container
restart: always
command: ./commands/start_server.sh
ports:
- "${PORT}:${WSGI_PORT}"
volumes:
- ./src:/srv/project/src
- ./commands:/srv/project/commands
- static_content:/var/www/site
env_file:
- .env
depends_on:
- postgres
postgres:
image: postgres:12
volumes:
- pg_data:/var/lib/postgresql/data
env_file:
- .env
# environment: …Run Code Online (Sandbox Code Playgroud)