TandoorRecipes / recipes

Application for managing recipes, planning meals, building shopping lists and much much more!
https://docs.tandoor.dev
Other
5.34k stars 563 forks source link

Connection Refused after install #1531

Closed reibuehl closed 2 years ago

reibuehl commented 2 years ago

Issue

I have installed TandoorRecipes with docker-compose. All three containers are up and running but when I try to access it via http:///, I only get a connection refused from the browser. The onlything strange I could find in the logs is that the nginx container seems to have a weird timestamp. (see logs below)

Tandoor Version

Can't login, but docker image is vabene1111/recipes:latest from 5 days ago

OS Version

Debian 10.11

Setup

Docker / Docker-Compose

Reverse Proxy

No reverse proxy

Other

No response

Environment file

# only set this to true when testing/debugging
# when unset: 1 (true) - dont unset this, just for development
DEBUG=0
SQL_DEBUG=0

# HTTP port to bind to
# TANDOOR_PORT=8080

# hosts the application can run under e.g. recipes.mydomain.com,cooking.mydomain.com,...
ALLOWED_HOSTS=*

# random secret key, use for example `base64 /dev/urandom | head -c50` to generate one
# ---------------------------- REQUIRED -------------------------
SECRET_KEY=xxxx
# ---------------------------------------------------------------

# your default timezone See https://timezonedb.com/time-zones for a list of timezones
TIMEZONE=Europe/Berlin

# add only a database password if you want to run with the default postgres, otherwise change settings accordingly
DB_ENGINE=django.db.backends.postgresql
# DB_OPTIONS= {} # e.g. {"sslmode":"require"} to enable ssl
POSTGRES_HOST=db_recipes
POSTGRES_PORT=5432
POSTGRES_USER=xxxx
# ---------------------------- REQUIRED -------------------------
POSTGRES_PASSWORD=xxxx
# ---------------------------------------------------------------
POSTGRES_DB=djangodb

# database connection string, when used overrides other database settings.
# format might vary depending on backend
# DATABASE_URL = engine://username:password@host:port/dbname

# the default value for the user preference 'fractions' (enable/disable fraction support)
# default: disabled=0
FRACTION_PREF_DEFAULT=0

# the default value for the user preference 'comments' (enable/disable commenting system)
# default comments enabled=1
COMMENT_PREF_DEFAULT=1

# Users can set a amount of time after which the shopping list is refreshed when they are in viewing mode
# This is the minimum interval users can set. Setting this to low will allow users to refresh very frequently which
# might cause high load on the server. (Technically they can obviously refresh as often as they want with their own scripts)
SHOPPING_MIN_AUTOSYNC_INTERVAL=5

# Default for user setting sticky navbar
# STICKY_NAV_PREF_DEFAULT=1

# If base URL is something other than just / (you are serving a subfolder in your proxy for instance http://recipe_app/recipes/)
# Be sure to not have a trailing slash: e.g. '/recipes' instead of '/recipes/'
# SCRIPT_NAME=/recipes

# If staticfiles are stored at a different location uncomment and change accordingly, MUST END IN /
# this is not required if you are just using a subfolder
# This can either be a relative path from the applications base path or the url of an external host
# STATIC_URL=/static/

# If mediafiles are stored at a different location uncomment and change accordingly, MUST END IN /
# this is not required if you are just using a subfolder
# This can either be a relative path from the applications base path or the url of an external host
# MEDIA_URL=/media/

# Serve mediafiles directly using gunicorn. Basically everyone recommends not doing this. Please use any of the examples
# provided that include an additional nxginx container to handle media file serving.
# If you know what you are doing turn this back on (1) to serve media files using djangos serve() method.
# when unset: 1 (true) - this is temporary until an appropriate amount of time has passed for everyone to migrate
GUNICORN_MEDIA=0

# S3 Media settings: store mediafiles in s3 or any compatible storage backend (e.g. minio)
# as long as S3_ACCESS_KEY is not set S3 features are disabled
# S3_ACCESS_KEY=
# S3_SECRET_ACCESS_KEY=
# S3_BUCKET_NAME=
# S3_REGION_NAME= # default none, set your region might be required
# S3_QUERYSTRING_AUTH=1 # default true, set to 0 to serve media from a public bucket without signed urls
# S3_QUERYSTRING_EXPIRE=3600 # number of seconds querystring are valid for
# S3_ENDPOINT_URL= # when using a custom endpoint like minio

# Email Settings, see https://docs.djangoproject.com/en/3.2/ref/settings/#email-host
# Required for email confirmation and password reset (automatically activates if host is set)
# EMAIL_HOST=
# EMAIL_PORT=
# EMAIL_HOST_USER=
# EMAIL_HOST_PASSWORD=
# EMAIL_USE_TLS=0
# EMAIL_USE_SSL=0
# DEFAULT_FROM_EMAIL= # email sender address (default 'webmaster@localhost')
# ACCOUNT_EMAIL_SUBJECT_PREFIX= # prefix used for account related emails (default "[Tandoor Recipes] ")

# allow authentication via reverse proxy (e.g. authelia), leave off if you dont know what you are doing
# see docs for more information https://vabene1111.github.io/recipes/features/authentication/
# when unset: 0 (false)
REVERSE_PROXY_AUTH=0

# Default settings for spaces, apply per space and can be changed in the admin view
# SPACE_DEFAULT_MAX_RECIPES=0 # 0=unlimited recipes
# SPACE_DEFAULT_MAX_USERS=0 # 0=unlimited users per space
# SPACE_DEFAULT_MAX_FILES=0 # Maximum file storage for space in MB. 0 for unlimited, -1 to disable file upload.
# SPACE_DEFAULT_ALLOW_SHARING=1 # Allow users to share recipes with public links

# allow people to create accounts on your application instance (without an invite link)
# when unset: 0 (false)
# ENABLE_SIGNUP=0

# If signup is enabled you might want to add a captcha to it to prevent spam
# HCAPTCHA_SITEKEY=
# HCAPTCHA_SECRET=

# if signup is enabled you might want to provide urls to data protection policies or terms and conditions
# TERMS_URL=
# PRIVACY_URL=
# IMPRINT_URL=

# enable serving of prometheus metrics under the /metrics path
# ATTENTION: view is not secured (as per the prometheus default way) so make sure to secure it
# trough your web server (or leave it open of you dont care if the stats are exposed)
# ENABLE_METRICS=0

# allows you to setup OAuth providers
# see docs for more information https://vabene1111.github.io/recipes/features/authentication/
# SOCIAL_PROVIDERS = allauth.socialaccount.providers.github, allauth.socialaccount.providers.nextcloud,

# Should a newly created user from a social provider get assigned to the default space and given permission by default ?
# ATTENTION: This feature might be deprecated in favor of a space join and public viewing system in the future
# default 0 (false), when 1 (true) users will be assigned space and group
# SOCIAL_DEFAULT_ACCESS = 1

# if SOCIAL_DEFAULT_ACCESS is used, which group should be added
# SOCIAL_DEFAULT_GROUP=guest

# Django session cookie settings. Can be changed to allow a single django application to authenticate several applications
# when running under the same database
# SESSION_COOKIE_DOMAIN=.example.com
# SESSION_COOKIE_NAME=sessionid # use this only to not interfere with non unified django applications under the same top level domain

# by default SORT_TREE_BY_NAME is disabled this will store all Keywords and Food in the order they are created
# enabling this setting makes saving new keywords and foods very slow, which doesn't matter in most usecases.
# however, when doing large imports of recipes that will create new objects, can increase total run time by 10-15x
# Keywords and Food can be manually sorted by name in Admin
# This value can also be temporarily changed in Admin, it will revert the next time the application is started
# This will be fixed/changed in the future by changing the implementation or finding a better workaround for sorting
# SORT_TREE_BY_NAME=0
# LDAP authentication
# default 0 (false), when 1 (true) list of allowed users will be fetched from LDAP server
#LDAP_AUTH=
#AUTH_LDAP_SERVER_URI=
#AUTH_LDAP_BIND_DN=
#AUTH_LDAP_BIND_PASSWORD=
#AUTH_LDAP_USER_SEARCH_BASE_DN=
#AUTH_LDAP_TLS_CACERTFILE=

# Enables exporting PDF (see export docs)
# Disabled by default, uncomment to enable
# ENABLE_PDF_EXPORT=1

# Recipe exports are cached for a certain time by default, adjust time if needed
# EXPORT_FILE_CACHE_DURATION=600

Docker-Compose file

version: '3.3'
services:
    db_recipes:
        image: postgres:11-bullseye
        restart: always
        volumes:
            - ./recipes_postgresql:/var/lib/postgresql/data
        user: '1000:1000'
        env_file:
            - ./.env
    web_recipes:
        image: vabene1111/recipes
        volumes:
            - ./recipes_staticfiles:/opt/recipes/staticfiles
            - ./recipes_nginx_config:/opt/recipes/nginx/conf.d
            - ./recipes_mediafiles:/opt/recipes/mediafiles
        env_file:
            - ./.env
        depends_on:
            - db_recipes
    nginx_recipes:
        image: nginx:mainline-alpine
        restart: always
        ports:
            - 80:80
        volumes:
            - ./recipes_nginx_config:/etc/nginx/conf.d:ro
            - ./recipes_staticfiles:/static
            - ./recipes_mediafiles:/media
        env_file:
            - ./.env
        depends_on:
            - web_recipes

Relevant logs

nginx_recipes_1  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx_recipes_1  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
nginx_recipes_1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
nginx_recipes_1  | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
nginx_recipes_1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
nginx_recipes_1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
nginx_recipes_1  | /docker-entrypoint.sh: Configuration complete; ready for start up
nginx_recipes_1  | 2071/07/11 01:20:24 [notice] 1#1: using the "epoll" event method
nginx_recipes_1  | 2071/07/11 01:20:24 [notice] 1#1: nginx/1.21.6
nginx_recipes_1  | 2071/07/11 01:20:24 [notice] 1#1: built by gcc 10.3.1 20211027 (Alpine 10.3.1_git20211027)
nginx_recipes_1  | 2071/07/11 01:20:24 [notice] 1#1: OS: Linux 5.10.60-sunxi
nginx_recipes_1  | 2071/07/11 01:20:24 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
nginx_recipes_1  | 2071/07/11 01:20:24 [notice] 1#1: start worker processes
nginx_recipes_1  | 2071/07/11 01:20:24 [notice] 1#1: start worker process 21
nginx_recipes_1  | 2071/07/11 01:20:24 [notice] 1#1: start worker process 22

web_recipes_1    | Updating database
web_recipes_1    | Operations to perform:
web_recipes_1    |   Apply all migrations: account, admin, auth, authtoken, contenttypes, cookbook, sessions, sites, socialaccount
web_recipes_1    | Running migrations:
web_recipes_1    |   Applying contenttypes.0001_initial... OK
web_recipes_1    |   Applying auth.0001_initial... OK
web_recipes_1    |   Applying account.0001_initial... OK
web_recipes_1    |   Applying account.0002_email_max_length... OK
web_recipes_1    |   Applying admin.0001_initial... OK
web_recipes_1    |   Applying admin.0002_logentry_remove_auto_add... OK
web_recipes_1    |   Applying admin.0003_logentry_add_action_flag_choices... OK
web_recipes_1    |   Applying contenttypes.0002_remove_content_type_name... OK
web_recipes_1    |   Applying auth.0002_alter_permission_name_max_length... OK
web_recipes_1    |   Applying auth.0003_alter_user_email_max_length... OK
web_recipes_1    |   Applying auth.0004_alter_user_username_opts... OK
web_recipes_1    |   Applying auth.0005_alter_user_last_login_null... OK
web_recipes_1    |   Applying auth.0006_require_contenttypes_0002... OK
web_recipes_1    |   Applying auth.0007_alter_validators_add_error_messages... OK
web_recipes_1    |   Applying auth.0008_alter_user_username_max_length... OK
web_recipes_1    |   Applying auth.0009_alter_user_last_name_max_length... OK
web_recipes_1    |   Applying auth.0010_alter_group_name_max_length... OK
web_recipes_1    |   Applying auth.0011_update_proxy_permissions... OK
web_recipes_1    |   Applying auth.0012_alter_user_first_name_max_length... OK
web_recipes_1    |   Applying authtoken.0001_initial... OK
web_recipes_1    |   Applying authtoken.0002_auto_20160226_1747... OK
web_recipes_1    |   Applying authtoken.0003_tokenproxy... OK
web_recipes_1    |   Applying cookbook.0001_initial... OK
web_recipes_1    |   Applying cookbook.0002_auto_20191119_2035... OK
web_recipes_1    |   Applying cookbook.0003_enable_pgtrm... OK
web_recipes_1    |   Applying cookbook.0004_storage_created_by... OK
web_recipes_1    |   Applying cookbook.0005_recipebook_recipebookentry... OK
web_recipes_1    |   Applying cookbook.0006_recipe_image... OK
web_recipes_1    |   Applying cookbook.0007_auto_20191226_0852... OK
web_recipes_1    |   Applying cookbook.0008_mealplan... OK
web_recipes_1    |   Applying cookbook.0009_auto_20200130_1056... OK
web_recipes_1    |   Applying cookbook.0010_auto_20200130_1059... OK
web_recipes_1    |   Applying cookbook.0011_remove_recipeingredients_unit... OK
web_recipes_1    |   Applying cookbook.0012_auto_20200130_1116... OK
web_recipes_1    |   Applying cookbook.0013_userpreference... OK
web_recipes_1    |   Applying cookbook.0014_auto_20200213_2332... OK
web_recipes_1    |   Applying cookbook.0015_auto_20200213_2334... OK
web_recipes_1    |   Applying cookbook.0016_auto_20200213_2335... OK
web_recipes_1    |   Applying cookbook.0017_auto_20200216_2257... OK
web_recipes_1    |   Applying cookbook.0018_auto_20200216_2303... OK
web_recipes_1    |   Applying cookbook.0019_ingredient... OK
web_recipes_1    |   Applying cookbook.0020_recipeingredient_ingredient... OK
web_recipes_1    |   Applying cookbook.0021_auto_20200216_2309... OK
web_recipes_1    |   Applying cookbook.0022_remove_recipeingredient_name... OK
web_recipes_1    |   Applying cookbook.0023_auto_20200216_2311... OK
web_recipes_1    |   Applying cookbook.0024_auto_20200216_2313... OK
web_recipes_1    |   Applying cookbook.0025_userpreference_nav_color... OK
web_recipes_1    |   Applying cookbook.0026_auto_20200219_1605... OK
web_recipes_1    |   Applying cookbook.0027_ingredient_recipe... OK
web_recipes_1    |   Applying cookbook.0028_auto_20200317_1901... OK
web_recipes_1    |   Applying cookbook.0029_auto_20200317_1901... OK
web_recipes_1    |   Applying cookbook.0030_recipeingredient_note... OK
web_recipes_1    |   Applying cookbook.0031_auto_20200407_1841... OK
web_recipes_1    |   Applying cookbook.0032_userpreference_default_unit... OK
web_recipes_1    |   Applying cookbook.0033_userpreference_default_page... OK
web_recipes_1    |   Applying cookbook.0034_auto_20200426_1614... OK
web_recipes_1    |   Applying cookbook.0035_auto_20200427_1637... OK
web_recipes_1    |   Applying cookbook.0036_auto_20200427_1800... OK
web_recipes_1    |   Applying cookbook.0037_userpreference_search_style... OK
web_recipes_1    |   Applying cookbook.0038_auto_20200502_1259... OK
web_recipes_1    |   Applying cookbook.0039_recipebook_shared... OK
web_recipes_1    |   Applying cookbook.0040_auto_20200502_1433... OK
web_recipes_1    |   Applying cookbook.0041_auto_20200502_1446... OK
web_recipes_1    |   Applying cookbook.0042_cooklog... OK
web_recipes_1    |   Applying cookbook.0043_auto_20200507_2302... OK
web_recipes_1    |   Applying cookbook.0044_viewlog... OK
web_recipes_1    |   Applying cookbook.0045_userpreference_show_recent... OK
web_recipes_1    |   Applying cookbook.0046_auto_20200602_1133... OK
web_recipes_1    |   Applying cookbook.0047_auto_20200602_1133... OK
web_recipes_1    |   Applying cookbook.0048_auto_20200602_1140... OK
web_recipes_1    |   Applying cookbook.0049_mealtype_created_by... OK
web_recipes_1    |   Applying cookbook.0050_auto_20200611_1509... OK
web_recipes_1    |   Applying cookbook.0051_auto_20200611_1518... OK
web_recipes_1    |   Applying cookbook.0052_userpreference_ingredient_decimals... OK
web_recipes_1    |   Applying cookbook.0053_auto_20200611_2217... OK
web_recipes_1    |   Applying cookbook.0054_sharelink... OK
web_recipes_1    |   Applying cookbook.0055_auto_20200616_1236... OK
web_recipes_1    |   Applying cookbook.0056_auto_20200625_2118... OK
web_recipes_1    |   Applying cookbook.0057_auto_20200625_2127... OK
web_recipes_1    |   Applying cookbook.0058_auto_20200625_2128... OK
web_recipes_1    |   Applying cookbook.0059_auto_20200625_2137... OK
web_recipes_1    |   Applying cookbook.0060_auto_20200625_2144... OK
web_recipes_1    |   Applying cookbook.0056_auto_20200625_2157... OK
web_recipes_1    |   Applying cookbook.0061_merge_20200625_2209... OK
web_recipes_1    |   Applying cookbook.0062_auto_20200625_2219... OK
web_recipes_1    |   Applying cookbook.0063_auto_20200625_2230... OK
web_recipes_1    |   Applying cookbook.0064_auto_20200625_2329... OK
web_recipes_1    |   Applying cookbook.0065_auto_20200626_1444... OK
web_recipes_1    |   Applying cookbook.0066_auto_20200626_1455... OK
web_recipes_1    |   Applying cookbook.0067_auto_20200629_1508... OK
web_recipes_1    |   Applying cookbook.0068_auto_20200629_2127... OK
web_recipes_1    |   Applying cookbook.0069_auto_20200629_2134... OK
web_recipes_1    |   Applying cookbook.0070_auto_20200701_2007... OK
web_recipes_1    |   Applying cookbook.0071_auto_20200701_2048... OK
web_recipes_1    |   Applying cookbook.0072_step_show_as_header... OK
web_recipes_1    |   Applying cookbook.0073_auto_20200708_2311... OK
web_recipes_1    |   Applying cookbook.0074_remove_keyword_created_by... OK
web_recipes_1    |   Applying cookbook.0075_shoppinglist_shoppinglistentry_shoppinglistrecipe... OK
web_recipes_1    |   Applying cookbook.0076_shoppinglist_entries... OK
web_recipes_1    |   Applying cookbook.0077_invitelink... OK
web_recipes_1    |   Applying cookbook.0078_invitelink_used_by... OK
web_recipes_1    |   Applying cookbook.0079_invitelink_group... OK
web_recipes_1    |   Applying cookbook.0080_auto_20200921_2331... OK
web_recipes_1    |   Applying cookbook.0081_auto_20200921_2349... OK
web_recipes_1    |   Applying cookbook.0082_auto_20200922_1143... OK
web_recipes_1    |   Applying cookbook.0083_space... OK
web_recipes_1    |   Applying cookbook.0084_auto_20200922_1233... OK
web_recipes_1    |   Applying cookbook.0085_auto_20200922_1235... OK
web_recipes_1    |   Applying cookbook.0086_auto_20200929_1143... OK
web_recipes_1    |   Applying cookbook.0087_auto_20200929_1152... OK
web_recipes_1    |   Applying cookbook.0088_shoppinglist_finished... OK
web_recipes_1    |   Applying cookbook.0089_auto_20201117_2222... OK
web_recipes_1    |   Applying cookbook.0090_auto_20201214_1359... OK
web_recipes_1    |   Applying cookbook.0091_auto_20201226_1551... OK
web_recipes_1    |   Applying cookbook.0092_recipe_servings... OK
web_recipes_1    |   Applying cookbook.0093_auto_20201231_1236... OK
web_recipes_1    |   Applying cookbook.0094_auto_20201231_1238... OK
web_recipes_1    |   Applying cookbook.0095_auto_20210107_1804... OK
web_recipes_1    |   Applying cookbook.0096_auto_20210109_2044... OK
web_recipes_1    |   Applying cookbook.0097_auto_20210113_1315... OK
web_recipes_1    |   Applying cookbook.0098_auto_20210113_1320... OK
web_recipes_1    |   Applying cookbook.0099_auto_20210113_1518... OK
web_recipes_1    |   Applying cookbook.0100_recipe_servings_text... OK
web_recipes_1    |   Applying cookbook.0101_storage_path... OK
web_recipes_1    |   Applying cookbook.0102_auto_20210125_1147... OK
web_recipes_1    |   Applying cookbook.0103_food_ignore_shopping... OK
web_recipes_1    |   Applying cookbook.0104_auto_20210125_2133... OK
web_recipes_1    |   Applying cookbook.0105_auto_20210126_1604... OK
web_recipes_1    |   Applying cookbook.0106_shoppinglist_supermarket... OK
web_recipes_1    |   Applying cookbook.0107_auto_20210128_1535... OK
web_recipes_1    |   Applying cookbook.0108_auto_20210219_1410... OK
web_recipes_1    |   Applying cookbook.0109_auto_20210221_1204... OK
web_recipes_1    |   Applying cookbook.0110_auto_20210221_1406... OK
web_recipes_1    |   Applying cookbook.0111_space_created_by... OK
web_recipes_1    |   Applying cookbook.0112_remove_synclog_space... OK
web_recipes_1    |   Applying cookbook.0113_auto_20210317_2017... OK
web_recipes_1    |   Applying cookbook.0114_importlog... OK
web_recipes_1    |   Applying cookbook.0115_telegrambot... OK
web_recipes_1    |   Applying cookbook.0116_auto_20210319_0012... OK
web_recipes_1    |   Applying cookbook.0117_space_max_recipes... OK
web_recipes_1    |   Applying cookbook.0118_auto_20210406_1805... OK
web_recipes_1    |   Applying cookbook.0119_auto_20210411_2101... OK
web_recipes_1    |   Applying cookbook.0120_bookmarklet... OK
web_recipes_1    |   Applying cookbook.0121_auto_20210518_1638... OK
web_recipes_1    |   Applying cookbook.0122_auto_20210527_1712... OK
web_recipes_1    |   Applying cookbook.0123_invitelink_email... OK
web_recipes_1    |   Applying cookbook.0124_alter_userpreference_theme... OK
web_recipes_1    |   Applying cookbook.0125_space_demo... OK
web_recipes_1    |   Applying cookbook.0126_alter_userpreference_theme... OK
web_recipes_1    |   Applying cookbook.0127_remove_invitelink_username... OK
web_recipes_1    |   Applying cookbook.0128_userfile... OK
web_recipes_1    |   Applying cookbook.0129_auto_20210608_1233... OK
web_recipes_1    |   Applying cookbook.0130_alter_userfile_file_size_kb... OK
web_recipes_1    |   Applying cookbook.0131_auto_20210608_1929... OK
web_recipes_1    |   Applying cookbook.0132_sharelink_request_count... OK
web_recipes_1    |   Applying cookbook.0133_sharelink_abuse_blocked... OK
web_recipes_1    |   Applying cookbook.0134_space_allow_sharing... OK
web_recipes_1    |   Applying cookbook.0135_auto_20210615_2210... OK
web_recipes_1    |   Applying cookbook.0136_auto_20210617_1343... OK
web_recipes_1    |   Applying cookbook.0137_auto_20210617_1501... OK
web_recipes_1    |   Applying cookbook.0138_auto_20210617_1602... OK
web_recipes_1    |   Applying cookbook.0139_space_created_at... OK
web_recipes_1    |   Applying cookbook.0140_userpreference_created_at... OK
web_recipes_1    |   Applying cookbook.0141_auto_20210713_1042... OK
web_recipes_1    |   Applying cookbook.0142_alter_userpreference_search_style... OK
web_recipes_1    |   Applying cookbook.0143_build_full_text_index... OK
web_recipes_1    |   Applying cookbook.0144_create_searchfields... OK
web_recipes_1    |   Applying cookbook.0145_alter_userpreference_search_style... OK
web_recipes_1    |   Applying cookbook.0146_alter_userpreference_use_fractions... OK
web_recipes_1    |   Applying cookbook.0147_keyword_to_tree... OK
web_recipes_1    |   Applying cookbook.0148_auto_20210813_1829... OK
web_recipes_1    |   Applying cookbook.0149_fix_leading_trailing_spaces... OK
web_recipes_1    |   Applying cookbook.0150_food_to_tree... OK
web_recipes_1    |   Applying cookbook.0151_auto_20210915_1037... OK
web_recipes_1    |   Applying cookbook.0152_automation... OK
web_recipes_1    |   Applying cookbook.0153_auto_20210915_2327... OK
web_recipes_1    |   Applying cookbook.0154_auto_20210922_1705... OK
web_recipes_1    |   Applying cookbook.0155_mealtype_default... OK
web_recipes_1    |   Applying cookbook.0156_searchpreference_trigram_threshold... OK
web_recipes_1    |   Applying cookbook.0157_alter_searchpreference_trigram... OK
web_recipes_1    |   Applying cookbook.0158_userpreference_use_kj... OK
web_recipes_1    |   Applying cookbook.0159_add_shoppinglistentry_fields... OK
web_recipes_1    |   Applying cookbook.0160_delete_shoppinglist_orphans... OK
web_recipes_1    |   Applying cookbook.0161_alter_shoppinglistentry_food... OK
web_recipes_1    |   Applying cookbook.0162_userpreference_csv_delim... OK
web_recipes_1    |   Applying cookbook.0163_auto_20220105_0758... OK
web_recipes_1    |   Applying cookbook.0164_space_show_facet_count... OK
web_recipes_1    |   Applying cookbook.0165_remove_step_type... OK
web_recipes_1    |   Applying cookbook.0166_alter_userpreference_shopping_add_onhand... OK
web_recipes_1    |   Applying cookbook.0167_userpreference_left_handed... OK
web_recipes_1    |   Applying cookbook.0168_add_unit_searchfields... OK
web_recipes_1    |   Applying cookbook.0169_exportlog... OK
web_recipes_1    |   Applying sessions.0001_initial... OK
web_recipes_1    |   Applying sites.0001_initial... OK
web_recipes_1    |   Applying sites.0002_alter_domain_unique... OK
web_recipes_1    |   Applying socialaccount.0001_initial... OK
web_recipes_1    |   Applying socialaccount.0002_token_max_lengths... OK
web_recipes_1    |   Applying socialaccount.0003_extra_data_default_dict... OK
web_recipes_1    | js-reverse file written to /opt/recipes/cookbook/static/django_js_reverse
web_recipes_1    |
web_recipes_1    | 1 static file copied to '/opt/recipes/staticfiles', 1024 unmodified, 1936 post-processed.
web_recipes_1    | Done
web_recipes_1    | [2022-02-13 18:45:33 +0000] [1] [INFO] Starting gunicorn 20.1.0
web_recipes_1    | [2022-02-13 18:45:33 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
web_recipes_1    | [2022-02-13 18:45:33 +0000] [1] [INFO] Using worker: sync
web_recipes_1    | [2022-02-13 18:45:33 +0000] [10] [INFO] Booting worker with pid: 10

db_recipes_1     | chmod: changing permissions of '/var/run/postgresql': Operation not permitted
db_recipes_1     |
db_recipes_1     | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_recipes_1     |
db_recipes_1     | 2022-02-13 18:39:51.076 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_recipes_1     | 2022-02-13 18:39:51.076 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_recipes_1     | 2022-02-13 18:39:51.093 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_recipes_1     | 2022-02-13 18:39:51.276 UTC [13] LOG:  database system was shut down at 2022-02-13 18:32:51 UTC
db_recipes_1     | 2022-02-13 18:39:51.363 UTC [1] LOG:  database system is ready to accept connections
MaxJa4 commented 2 years ago

The date/time of nginx container is indeed weird, but I saw similar weird dates before in working setups. I'm more concerned about one of the last lines: chmod: changing permissions of '/var/run/postgresql': Operation not permitted Does it work, when you remove your manually added user: '1000:1000' in the docker-compose file?

Nginx should still allow a connection though... is that port maybe not opened in your firewall? Try wget -nv -t1 --spider <URL_TO_YOUR_SITE> on the hosting machine. Use the domain you use to access the site from outside (like http(s)://recipes.domain.tld) and then try it with the local version (probably just http://localhost/ in your case since nginx is the default port 80). This should narrow down the issue somewhat. Please report back with the result of these two tests.

reibuehl commented 2 years ago

The two wget commands produce the following result:

failed: Connection refused.
root@bananapi:~# wget -nv -t1 --spider http://localhost
Read error (Connection reset by peer) in headers.
root@bananapi:~#

I then removed the user line from the docker-compose file and restarted. The wget commands return the same afterwards. The db log now shows

db_recipes_1     | PostgreSQL Database directory appears to contain a database; Skipping initialization
db_recipes_1     |
db_recipes_1     | 2022-02-14 10:25:57.505 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db_recipes_1     | 2022-02-14 10:25:57.506 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db_recipes_1     | 2022-02-14 10:25:57.521 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db_recipes_1     | 2022-02-14 10:25:57.773 UTC [25] LOG:  database system was shut down at 2022-02-14 10:24:54 UTC
db_recipes_1     | 2022-02-14 10:25:57.891 UTC [1] LOG:  database system is ready to accept connections

but the directory has changed owner to systemd-coredump (UID 999) which seems random and is not what I wanted the DB files to be.

The other logs look still uneventful except for the strange date in nginx:

web_recipes_1    | Operations to perform:
web_recipes_1    |   Apply all migrations: account, admin, auth, authtoken, contenttypes, cookbook, sessions, sites, socialaccount
web_recipes_1    | Running migrations:
web_recipes_1    |   No migrations to apply.
web_recipes_1    | js-reverse file written to /opt/recipes/cookbook/static/django_js_reverse
web_recipes_1    |
web_recipes_1    | 1 static file copied to '/opt/recipes/staticfiles', 1024 unmodified, 1936 post-processed.
web_recipes_1    | Done
web_recipes_1    | [2022-02-14 10:28:08 +0000] [1] [INFO] Starting gunicorn 20.1.0
web_recipes_1    | [2022-02-14 10:28:08 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
web_recipes_1    | [2022-02-14 10:28:08 +0000] [1] [INFO] Using worker: sync
web_recipes_1    | [2022-02-14 10:28:08 +0000] [11] [INFO] Booting worker with pid: 11

nginx_recipes_1  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx_recipes_1  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
nginx_recipes_1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
nginx_recipes_1  | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
nginx_recipes_1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
nginx_recipes_1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
nginx_recipes_1  | /docker-entrypoint.sh: Configuration complete; ready for start up
nginx_recipes_1  | 2071/04/20 11:13:28 [notice] 1#1: using the "epoll" event method
nginx_recipes_1  | 2071/04/20 11:13:28 [notice] 1#1: nginx/1.21.6
nginx_recipes_1  | 2071/04/20 11:13:28 [notice] 1#1: built by gcc 10.3.1 20211027 (Alpine 10.3.1_git20211027)
nginx_recipes_1  | 2071/04/20 11:13:28 [notice] 1#1: OS: Linux 5.10.60-sunxi
nginx_recipes_1  | 2071/04/20 11:13:28 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
nginx_recipes_1  | 2071/04/20 11:13:28 [notice] 1#1: start worker processes
nginx_recipes_1  | 2071/04/20 11:13:28 [notice] 1#1: start worker process 21
nginx_recipes_1  | 2071/04/20 11:13:28 [notice] 1#1: start worker process 22
MaxJa4 commented 2 years ago

Thank you for testing that. Since nginx doesn't complain at all and port 80 is configured in the compose yml it's odd that no errors are shown... are there any additional infos in the logs when you set DEBUG=1 in the .env file? Probably need to restart the containers after changing that.

Also, can you please check if the nginx config file in the named volume "recipes_nginx_config" (it's probably at /var/lib/docker/volumes/recipes_nginx_config/_data) is identical to the one in the repository here on GitHub (nginx/conf.d/Recipes.conf)? Maybe something is odd there.

reibuehl commented 2 years ago

The nginx config file did not exist in the named volume! I guess I must have forgotten to move it there when I changed to named volumes to keep everything in the same location. After copying the missing file to the expected location, everything is fine now and I can connect! Thanks very much! I switched back the DB to the UID 1000 - the error about the /var/run/postgresql is back but that does not seem to matter.

MaxJa4 commented 2 years ago

Great! I might add a check for existence of that file to the web container, so it is obvious from the log for the future :)