Skip to content

Commit

Permalink
updated docker compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
jabelone committed Aug 3, 2023
1 parent ec0e467 commit 227aa65
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 30 deletions.
83 changes: 55 additions & 28 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,76 @@
version: "3"
services:
# MemberMatters
membermatters:
image: membermatters/membermatters:celery
mm-postgres:
image: postgres:15.3-alpine
restart: always
environment:
PORTAL_ENV: "Production"
MM_REDIS_HOST: 'redis://membermatters-redis:6379/0'
volumes:
- ./:/usr/src/data
- POSTGRES_USER=membermatters
- POSTGRES_PASSWORD=membermatters
- POSTGRES_DB=membermatters
ports:
- "8000:8000"
- "5432:5432"
volumes:
- mm-postgres-volume:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U membermatters"]
interval: 5s
timeout: 5s
retries: 5

# MemberMatters Redis
membermatters-redis:
mm-redis:
image: redis
restart: always
depends_on:
- membermatters
- mm-postgres

# MemberMatters
mm-webapp:
image: membermatters/membermatters
restart: always
environment:
MM_ENV: "Production"
MM_SECRET_KEY: "CHANGE_ME"
MM_USE_POSTGRES: True
MM_REDIS_HOST: "redis://mm-redis:6379/0"
ports:
- "8000:8000"
depends_on:
- mm-postgres
- mm-redis
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000"]
interval: 5s
timeout: 5s
retries: 15

# MemberMatters Celery Worker
membermatters-celery-worker:
image: membermatters/membermatters:celery
mm-celery-worker:
image: membermatters/membermatters
restart: always
environment:
PORTAL_ENV: "Production"
MM_ENV: "Production"
MM_USE_POSTGRES: True
MM_RUN_MODE: "celery_worker"
MM_REDIS_HOST: 'redis://membermatters-redis:6379/0'
volumes:
- ./:/usr/src/data
MM_REDIS_HOST: "redis://mm-redis:6379/0"
depends_on:
- membermatters
- membermatters-redis
- mm-webapp
- mm-redis

# MemberMatters Celery Worker
membermatters-celery-beat:
image: membermatters/membermatters:celery
# MemberMatters Celery Beat
mm-celery-beat:
image: membermatters/membermatters
restart: always
environment:
PORTAL_ENV: "Production"
MM_ENV: "Production"
MM_USE_POSTGRES: True
MM_RUN_MODE: "celery_beat"
MM_REDIS_HOST: 'redis://membermatters-redis:6379/0'
volumes:
- ./:/usr/src/data
MM_REDIS_HOST: "redis://mm-redis:6379/0"
depends_on:
- membermatters
- membermatters-celery-worker
- membermatters-redis
- mm-webapp
- mm-celery-worker
- mm-redis

volumes:
mm-postgres-volume:
driver: local
14 changes: 13 additions & 1 deletion docs/GETTING_STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,19 @@ docker stop membermatters
docker restart membermatters
```

Once your container is running, you will be able to login with the default admin account details:
Once your container is running, you will probably want to load the initial database fixtures so there's an account you can use to login with. To do so, connect to your running docker container:

```bash
docker exec -it membermatters bash
```

and run the following:

```bash
python3 manage.py loaddata initial
```

Once you've loaded the initial fixtures, you will be able to login with the default admin account details:

```
Email: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion memberportal/membermatters/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"USER": os.environ.get("POSTGRES_USER", "membermatters"),
"PASSWORD": os.environ.get("POSTGRES_PASSWORD", "membermatters"),
"HOST": os.environ.get(
"POSTGRES_HOST", "membermatters-postgres"
"POSTGRES_HOST", "mm-postgres"
), # default for docker-compose - change if needed
"PORT": os.environ.get("POSTGRES_PORT", "5432"),
}
Expand Down

0 comments on commit 227aa65

Please sign in to comment.