Skip to content

Commit

Permalink
Add local Mailman 3 instance
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tomudding committed May 24, 2024
1 parent af03a07 commit 55f1ba2
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ LDAP_BASEDN=
# These are the environment variables for Postgres, only used in docker-compose.override.yaml for development
POSTGRES_PASSWORD=gewisdb
POSTGRES_USER=gewisdb
POSTGRES_MAILMAN_DATABASE=gewisdb_mailman
[email protected]
PGADMIN_DEFAULT_PASSWORD=pgadmin
PGADMIN_DISABLE_POSTFIX=true
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ phpcs.xml

# Language binaries are created during the docker build process or using 'make compilelang'
*.mo

# Local mailman data for development
mailman/
41 changes: 40 additions & 1 deletion docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
- .env
volumes:
- gewisdb_postgresql:/var/lib/postgresql/data:rw
- ./docker/pgadmin/create-gewisdb_report-database.sh:/docker-entrypoint-initdb.d/create-database.sh
- ./docker/pgadmin/create-gewisdb-database.sh:/docker-entrypoint-initdb.d/create-database.sh
networks:
- gewisdb_network
ports:
Expand All @@ -29,8 +29,46 @@ services:
image: mailhog/mailhog
ports:
- "8025:8025"
mailman-core:
image: maxking/mailman-core:0.4
container_name: mailman-core
hostname: mailman-core
volumes:
- ./mailman/core:/opt/mailman/
depends_on:
- postgresql
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgresql/${POSTGRES_MAILMAN_DATABASE}
- DATABASE_TYPE=postgres
- DATABASE_CLASS=mailman.database.postgresql.PostgreSQLDatabase
- HYPERKITTY_API_KEY=somerandomapikeythatiobviouslydidnotcreatemyself
ports:
- "8020:8001"
networks:
- gewisdb_network
mailman-web:
image: maxking/mailman-web:0.4
container_name: mailman-web
hostname: mailman-web
depends_on:
- postgresql
volumes:
- ./mailman/web:/opt/mailman-web-data/
environment:
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgresql/${POSTGRES_MAILMAN_DATABASE}
- DATABASE_TYPE=postgres
- HYPERKITTY_API_KEY=somerandomapikeythatiobviouslydidnotcreatemyself
- SECRET_KEY=anotherandomkeythatiobviouslydidnotcreatemyself
- SERVE_FROM_DOMAIN=localhost
- UWSGI_STATIC_MAP=/static=/opt/mailman-web-data/static
ports:
- "8021:8000"
networks:
- gewisdb_network
nginx:
build: docker/nginx
volumes:
- ./mailman/web/static:/var/html/mailman/
ports:
- "80:9725"
stripe:
Expand All @@ -50,6 +88,7 @@ services:
dockerfile: docker/web/development/Dockerfile
context: .
depends_on:
- mailman-core
- postgresql

volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-PGSQL
CREATE DATABASE $DOCTRINE_REPORT_DATABASE;
GRANT ALL PRIVILEGES ON DATABASE $DOCTRINE_REPORT_DATABASE TO $POSTGRES_USER;
CREATE DATABASE $POSTGRES_MAILMAN_DATABASE;
GRANT ALL PRIVILEGES ON DATABASE $POSTGRES_MAILMAN_DATABASE TO $POSTGRES_USER;
PGSQL

0 comments on commit 55f1ba2

Please sign in to comment.