Skip to content

Commit da095dd

Browse files
committed
Add local Mailman 3 instance
To create the superuser for configuration things in Postorius, execute `python manage.py createsuperuser` in the `mailman-web` container. This does not add authentication for the API endpoint.
1 parent 79a7f55 commit da095dd

File tree

4 files changed

+44
-1
lines changed

4 files changed

+44
-1
lines changed

.env.dist

+1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ LDAP_BASEDN=
5252
# These are the environment variables for Postgres, only used in docker-compose.override.yaml for development
5353
POSTGRES_PASSWORD=gewisdb
5454
POSTGRES_USER=gewisdb
55+
POSTGRES_MAILMAN_DATABASE=gewisdb_mailman
5556
5657
PGADMIN_DEFAULT_PASSWORD=pgadmin
5758
PGADMIN_DISABLE_POSTFIX=true

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ psalm/psalm-baseline-pr.xml
3232
.postgres
3333
config/bash.env
3434
.vscode
35+
mailman/

docker-compose.override.yml

+40-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
- .env
88
volumes:
99
- gewisdb_postgresql:/var/lib/postgresql/data:rw
10-
- ./docker/pgadmin/create-gewisdb_report-database.sh:/docker-entrypoint-initdb.d/create-database.sh
10+
- ./docker/pgadmin/create-gewisdb-database.sh:/docker-entrypoint-initdb.d/create-database.sh
1111
networks:
1212
- gewisdb_network
1313
ports:
@@ -31,8 +31,46 @@ services:
3131
image: mailhog/mailhog
3232
ports:
3333
- "8025:8025"
34+
mailman-core:
35+
image: maxking/mailman-core:0.4
36+
container_name: mailman-core
37+
hostname: mailman-core
38+
volumes:
39+
- ./mailman/core:/opt/mailman/
40+
depends_on:
41+
- postgresql
42+
environment:
43+
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgresql/${POSTGRES_MAILMAN_DATABASE}
44+
- DATABASE_TYPE=postgres
45+
- DATABASE_CLASS=mailman.database.postgresql.PostgreSQLDatabase
46+
- HYPERKITTY_API_KEY=somerandomapikeythatiobviouslydidnotcreatemyself
47+
ports:
48+
- "8020:8001"
49+
networks:
50+
- gewisdb_network
51+
mailman-web:
52+
image: maxking/mailman-web:0.4
53+
container_name: mailman-web
54+
hostname: mailman-web
55+
depends_on:
56+
- postgresql
57+
volumes:
58+
- ./mailman/web:/opt/mailman-web-data/
59+
environment:
60+
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgresql/${POSTGRES_MAILMAN_DATABASE}
61+
- DATABASE_TYPE=postgres
62+
- HYPERKITTY_API_KEY=somerandomapikeythatiobviouslydidnotcreatemyself
63+
- SECRET_KEY=anotherandomkeythatiobviouslydidnotcreatemyself
64+
- SERVE_FROM_DOMAIN=localhost
65+
- UWSGI_STATIC_MAP=/static=/opt/mailman-web-data/static
66+
ports:
67+
- "8021:8000"
68+
networks:
69+
- gewisdb_network
3470
nginx:
3571
build: docker/nginx
72+
volumes:
73+
- ./mailman/web/static:/var/html/mailman/
3674
ports:
3775
- "80:9725"
3876
web:
@@ -41,6 +79,7 @@ services:
4179
dockerfile: docker/web/development/Dockerfile
4280
context: .
4381
depends_on:
82+
- mailman-core
4483
- postgresql
4584

4685
volumes:

docker/pgadmin/create-gewisdb_report-database.sh renamed to docker/pgadmin/create-gewisdb-database.sh

+2
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ set -e
44
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-PGSQL
55
CREATE DATABASE $DOCTRINE_REPORT_DATABASE;
66
GRANT ALL PRIVILEGES ON DATABASE $DOCTRINE_REPORT_DATABASE TO $POSTGRES_USER;
7+
CREATE DATABASE $POSTGRES_MAILMAN_DATABASE;
8+
GRANT ALL PRIVILEGES ON DATABASE $POSTGRES_MAILMAN_DATABASE TO $POSTGRES_USER;
79
PGSQL

0 commit comments

Comments
 (0)