8 Jul
2021
8 Jul
'21
7:23 p.m.
I am starting small, My goal is just to get mailman3 running in docker and test the website access via curl from the host, then I will move on from there
In the docker instructions it says
SERVE_FROM_DOMAIN: The domain name from which Django will be served. To be added to ALLOWED_HOSTS in django settings. Default value is not set. This also replaces Django's default example.com SITE and becomes the default SITE (with SITE_ID=1).
But where do I set the ALLOWED_HOSTS I added this to the yaml file - ALLOWED_HOSTS=127.0.0.1 under environments
mailman-web:
image: maxking/mailman-web:0.3
container_name: mailman-web
hostname: mailman-web
depends_on:
- database
links:
- mailman-core:mailman-core
- database:database
volumes:
- /opt/mailman/web:/opt/mailman-web-data
environment:
- UWSGI_STATIC_MAP=/static=/opt/mailman-web-data/static
- ALLOWED_HOSTS=127.0.0.1
- DATABASE_TYPE=postgres
- DATABASE_URL=postgres://mailman:mailmanpass@database/mailmandb
- SECRET_KEY=333blah-blah-secret
- HYPERKITTY_API_KEY=333someapikey
ports:
- "127.0.0.1:8000:8000" # HTTP
- "127.0.0.1:8080:8080" # uwsgi
networks:
mailman:
But when I try: [docker-mailman]# curl 127.0.0.1:8000 <h1>Bad Request (400)</h1>[root@bmimailmandr1 docker-mailman]# [root@bmimailmandr1 docker-mailman]#
I see this in the logs
[docker-mailman]# cat /opt/mailman/web/logs/mailmanweb.log
WARNING 2021-07-08 17:40:46,979 1642 django.request Bad Request: /
ERROR 2021-07-08 19:20:58,416 1641 django.security.DisallowedHost Invalid HTTP_HOST header: '127.0.0.1:8000'. You may need to add '127.0.0.1' to ALLOWED_HOSTS.
WARNING 2021-07-08 19:20:59,032 1641 django.request Bad Request: /
WARNING 2021-07-08 19:20:59,032 1641 django.request Bad Request: /