Skip to content

Commit

Permalink
[#197] add a docker compose setup for testing a migration
Browse files Browse the repository at this point in the history
  • Loading branch information
SonnyBA committed Oct 18, 2024
1 parent 166ee6b commit b925912
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
40 changes: 40 additions & 0 deletions migration/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Stripped version of https://github.com/maykinmedia/open-klant/blob/1.0.0/docker-compose.yml

services:
db:
image: postgres
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ./docker-init-db.sql:/docker-entrypoint-initdb.d/init_db.sql:ro
- db:/var/lib/postgresql/data

web:
image: maykinmedia/open-klant:1.0.0
environment:
- DJANGO_SETTINGS_MODULE=openklant.conf.docker
- IS_HTTPS=no
- DB_NAME=postgres
- DB_USER=postgres
- DB_HOST=db
- ALLOWED_HOSTS=*
- CACHE_DEFAULT=redis:6379/0
- CACHE_AXES=redis:6379/0
- SECRET_KEY=${SECRET_KEY:-django-insecure-$8s@b*ds4t84-q_2#c0j0506@!l2q6r5_pq5e!vm^_9c*#^66b}
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
- NOTIFICATIONS_DISABLED=True
volumes:
- ./fixtures:/app/src/openklant/fixtures/migration:ro
ports:
- 8000:8000
depends_on:
- db
- redis

redis:
image: redis

volumes:
db:
log:
4 changes: 4 additions & 0 deletions migration/docker-init-db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CREATE USER openklant;
CREATE DATABASE openklant;
GRANT ALL PRIVILEGES ON DATABASE openklant TO openklant;

0 comments on commit b925912

Please sign in to comment.