From 062b7cb4f2d6957e4342e0b6633d476dd8085cf7 Mon Sep 17 00:00:00 2001 From: Peter Thornton Date: Fri, 13 Dec 2024 11:34:46 -0500 Subject: [PATCH 1/2] setting some default configs for docker-compose.yaml --- docker-compose.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docker-compose.yaml b/docker-compose.yaml index 27d5001..2de7347 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -19,6 +19,10 @@ services: - DATABASE_TYPE=postgres - DATABASE_CLASS=mailman.database.postgresql.PostgreSQLDatabase - HYPERKITTY_API_KEY=someapikey + - SMTP_HOST=localhost + - SMTP_PORT=25 + - SMTP_HOST_USER=postfix + ports: - "127.0.0.1:8001:8001" # API - "127.0.0.1:8024:8024" # LMTP - incoming emails @@ -42,6 +46,10 @@ services: - DATABASE_TYPE=postgres - DATABASE_URL=postgresql://mailman:mailmanpass@database/mailmandb - HYPERKITTY_API_KEY=someapikey + - SERVE_FROM_DOMAIN=devmailman.hks.harvard.edu + - MAILMAN_ADMIN_USER=pthornton + - MAILMAN_ADMIN_EMAIL=peter_thornton@hks.harvard.edu + - SECRET_KEY=somesecretkey ports: - "127.0.0.1:8000:8000" # HTTP - "127.0.0.1:8080:8080" # uwsgi From e8fc3074701041ee490abea67ed46c182d68c73f Mon Sep 17 00:00:00 2001 From: Peter Thornton Date: Fri, 24 Jan 2025 14:28:48 -0500 Subject: [PATCH 2/2] got nginx config working so dockerizing it --- docker-compose.yaml | 16 +++++++++++++++- nginx.conf | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 nginx.conf diff --git a/docker-compose.yaml b/docker-compose.yaml index 2de7347..aabc38a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -71,7 +71,21 @@ services: retries: 5 networks: mailman: - + nginx: + image: nginx:latest + container_name: nginx + ports: + - "443:443" + volumes: + - ./nginx.conf:/etc/nginx/conf.d/default.conf + - /path/to/ssl/certs:/etc/ssl/certs:ro + environment: + - SSL_CERT_PATH=/etc/ssl/certs/devmailman_hks_harvard_edu.pem + - SSL_CERT_KEY_PATH=/etc/ssl/certs/devmailman-hks-harvard.edu.key + depends_on: + - mailman-web + networks: + - mailman networks: mailman: driver: bridge diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..84918ee --- /dev/null +++ b/nginx.conf @@ -0,0 +1,20 @@ +server { + + listen 443 ssl default_server; + listen [::]:443 ssl default_server; + + server_name devmailman.hks.harvard.edu; + location /static/ { + alias /opt/mailman/web/static/; + } + + location / { + proxy_pass http://127.0.0.1:8000; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + + } + ssl_certificate /etc/ssl/certs/devmailman_hks_harvard_edu.pem; + ssl_certificate_key /etc/ssl/certs/devmailman-hks-harvard.edu.key; + +} \ No newline at end of file