Your volume setup looks incorrect to me. So the tandoor guy has an odd default setup he provides. I wanted the static files mapped so I could delete them from time to time as there were versions building up in there or something. I let nginx go to an anonymous volume. My config predates the new UI that supported env files so I just replicated the env settings to all three containers. It looks like this below. I've xxx out any secrets. I think I added the dependency health condition because the default config suggested was racing on startup and sometimes failing. Maybe that's what you are hitting, it's been a long time since I set this one up.
Code
version: "3"
services:
db_recipes:
restart: always
image: postgres:11-alpine
container_name: db_recipes
hostname: db_recipes
volumes:
- /apps/tandoor/postgresql:/var/lib/postgresql/data
environment:
- DEBUG=0
- ENABLE_SIGNUP=1
- SQL_DEBUG=0
- ALLOWED_HOSTS=*
- SECRET_KEY=xxx
- TIMEZONE=America/New_York
- DB_ENGINE=django.db.backends.postgresql
- POSTGRES_HOST=db_recipes
- POSTGRES_PORT=5432
- POSTGRES_USER=djangouser
- POSTGRES_PASSWORD=xxx
- POSTGRES_DB=djangodb
- FRACTION_PREF_DEFAULT=0
- COMMENT_PREF_DEFAULT=1
- SHOPPING_MIN_AUTOSYNC_INTERVAL=5
- GUNICORN_MEDIA=0
- REVERSE_PROXY_AUTH=0
- EMAIL_HOST=smtp.gmail.com
- EMAIL_PORT=465
- EMAIL_HOST_USER=xxx
- EMAIL_HOST_PASSWORD=xxx
- EMAIL_USE_TLS=0
- EMAIL_USE_SSL=1
- DEFAULT_FROM_EMAIL=xxx
- "ACCOUNT_EMAIL_SUBJECT_PREFIX=[Tandoor Recipes] "
healthcheck:
test: ["CMD-SHELL", "pg_isready -d djangodb -U djangouser"]
interval: 30s
start_period: 30s
timeout: 10s
retries: 5
web_recipes:
image: vabene1111/recipes
restart: always
container_name: web_recipes
hostname: web_recipes
environment:
- DEBUG=0
- ENABLE_SIGNUP=1
- SQL_DEBUG=0
- ALLOWED_HOSTS=*
- SECRET_KEY=xxx
- TIMEZONE=America/New_York
- DB_ENGINE=django.db.backends.postgresql
- POSTGRES_HOST=db_recipes
- POSTGRES_PORT=5432
- POSTGRES_USER=djangouser
- POSTGRES_PASSWORD=xxx
- POSTGRES_DB=djangodb
- FRACTION_PREF_DEFAULT=0
- COMMENT_PREF_DEFAULT=1
- SHOPPING_MIN_AUTOSYNC_INTERVAL=5
- GUNICORN_MEDIA=0
- REVERSE_PROXY_AUTH=0
- EMAIL_HOST=smtp.gmail.com
- EMAIL_PORT=465
- EMAIL_HOST_USER=xxx
- EMAIL_HOST_PASSWORD=xxx
- EMAIL_USE_TLS=0
- EMAIL_USE_SSL=1
- DEFAULT_FROM_EMAIL=xxx
- "ACCOUNT_EMAIL_SUBJECT_PREFIX=[Tandoor Recipes] "
volumes:
- /apps/tandoor/staticfiles:/opt/recipes/staticfiles
- nginx_config:/opt/recipes/nginx/conf.d
- /apps/tandoor/mediafiles:/opt/recipes/mediafiles
depends_on:
db_recipes:
condition: service_healthy
nginx_recipes:
image: nginx:mainline-alpine
restart: always
container_name: nginx_recipes
ports:
- 8089:80
environment:
- DEBUG=0
- ENABLE_SIGNUP=1
- SQL_DEBUG=0
- ALLOWED_HOSTS=*
- SECRET_KEY=xxx
- TIMEZONE=America/New_York
- DB_ENGINE=django.db.backends.postgresql
- POSTGRES_HOST=db_recipes
- POSTGRES_PORT=5432
- POSTGRES_USER=djangouser
- POSTGRES_PASSWORD=xxx
- POSTGRES_DB=djangodb
- FRACTION_PREF_DEFAULT=0
- COMMENT_PREF_DEFAULT=1
- SHOPPING_MIN_AUTOSYNC_INTERVAL=5
- GUNICORN_MEDIA=0
- REVERSE_PROXY_AUTH=0
- EMAIL_HOST=smtp.gmail.com
- EMAIL_PORT=465
- EMAIL_HOST_USER=xxx
- EMAIL_HOST_PASSWORD=xxx
- EMAIL_USE_TLS=0
- EMAIL_USE_SSL=1
- DEFAULT_FROM_EMAIL=xxx
- "ACCOUNT_EMAIL_SUBJECT_PREFIX=[Tandoor Recipes] "
depends_on:
- web_recipes
volumes:
- nginx_config:/etc/nginx/conf.d:ro
- /apps/tandoor/staticfiles:/static
- /apps/tandoor/mediafiles:/media
volumes:
nginx_config:
#staticfiles:
Alles anzeigen