Skip to content

Commit 55f1ba2

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 af03a07 commit 55f1ba2

File tree

4 files changed

+46
-1
lines changed

4 files changed

+46
-1
lines changed

.env.dist

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ LDAP_BASEDN=
6767
# These are the environment variables for Postgres, only used in docker-compose.override.yaml for development
6868
POSTGRES_PASSWORD=gewisdb
6969
POSTGRES_USER=gewisdb
70+
POSTGRES_MAILMAN_DATABASE=gewisdb_mailman
7071
7172
PGADMIN_DEFAULT_PASSWORD=pgadmin
7273
PGADMIN_DISABLE_POSTFIX=true

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,6 @@ phpcs.xml
3737

3838
# Language binaries are created during the docker build process or using 'make compilelang'
3939
*.mo
40+
41+
# Local mailman data for development
42+
mailman/

docker-compose.override.yml

+40-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
- .env
66
volumes:
77
- gewisdb_postgresql:/var/lib/postgresql/data:rw
8-
- ./docker/pgadmin/create-gewisdb_report-database.sh:/docker-entrypoint-initdb.d/create-database.sh
8+
- ./docker/pgadmin/create-gewisdb-database.sh:/docker-entrypoint-initdb.d/create-database.sh
99
networks:
1010
- gewisdb_network
1111
ports:
@@ -29,8 +29,46 @@ services:
2929
image: mailhog/mailhog
3030
ports:
3131
- "8025:8025"
32+
mailman-core:
33+
image: maxking/mailman-core:0.4
34+
container_name: mailman-core
35+
hostname: mailman-core
36+
volumes:
37+
- ./mailman/core:/opt/mailman/
38+
depends_on:
39+
- postgresql
40+
environment:
41+
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgresql/${POSTGRES_MAILMAN_DATABASE}
42+
- DATABASE_TYPE=postgres
43+
- DATABASE_CLASS=mailman.database.postgresql.PostgreSQLDatabase
44+
- HYPERKITTY_API_KEY=somerandomapikeythatiobviouslydidnotcreatemyself
45+
ports:
46+
- "8020:8001"
47+
networks:
48+
- gewisdb_network
49+
mailman-web:
50+
image: maxking/mailman-web:0.4
51+
container_name: mailman-web
52+
hostname: mailman-web
53+
depends_on:
54+
- postgresql
55+
volumes:
56+
- ./mailman/web:/opt/mailman-web-data/
57+
environment:
58+
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgresql/${POSTGRES_MAILMAN_DATABASE}
59+
- DATABASE_TYPE=postgres
60+
- HYPERKITTY_API_KEY=somerandomapikeythatiobviouslydidnotcreatemyself
61+
- SECRET_KEY=anotherandomkeythatiobviouslydidnotcreatemyself
62+
- SERVE_FROM_DOMAIN=localhost
63+
- UWSGI_STATIC_MAP=/static=/opt/mailman-web-data/static
64+
ports:
65+
- "8021:8000"
66+
networks:
67+
- gewisdb_network
3268
nginx:
3369
build: docker/nginx
70+
volumes:
71+
- ./mailman/web/static:/var/html/mailman/
3472
ports:
3573
- "80:9725"
3674
stripe:
@@ -50,6 +88,7 @@ services:
5088
dockerfile: docker/web/development/Dockerfile
5189
context: .
5290
depends_on:
91+
- mailman-core
5392
- postgresql
5493

5594
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)