From 598642a0db9f282e859bd8d7aec64467b7987147 Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Wed, 22 Jan 2025 21:24:19 +0100 Subject: [PATCH] Use a pghero docker image in the local environment --- README.md | 9 +++++---- docker-compose.yml | 10 +++++++++- nginx.conf | 9 +++++++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e1cc204..5905fd0 100644 --- a/README.md +++ b/README.md @@ -57,16 +57,17 @@ The backend service will seed the database with fake data. It's worth noting tha The backend, frontend and workers have hot-reloading enabled, so changes made to the codebase should be reflected in the application on the next request. -Once all containers have started, visit http://libre-wedding-planner.app.localhost/default/dashboard to load the application. +Once all containers have started, visit: + +- http://libre-wedding-planner.app.localhost/default to load the application. +- http://libre-wedding-planner.app.localhost/letter_opener/ to get a list of emails generated by the application. +- http://pghero.libre-wedding-planner.app.localhost to load the [pghero](https://github.com/ankane/pghero) tool. ## Multitenancy LibreWeddingPlanner is designed to manage multiple weddings in a single host. All URLs (in the API and the frontend) are scoped under a slug that is unique per wedding. The slug is made of lowercase letters, numbers, and dashes (-). The development environment is seeded with a wedding whose slug is `default`. -## Email delivery - -In the development environment, real emails will not be sent. You can visit http://libre-wedding-planner.app.localhost/letter_opener/ to get a list of emails generated by the application. ## Testing diff --git a/docker-compose.yml b/docker-compose.yml index 93cff59..7593984 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -79,5 +79,13 @@ services: interval: 10s timeout: 5s retries: 5 - + pghero: + image: ankane/pghero + ports: + - 8080 + environment: + DATABASE_URL: postgres://postgres:postgres@db:5432/postgres + depends_on: + db: + condition: service_healthy \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 58c2bb9..2d4c4c2 100644 --- a/nginx.conf +++ b/nginx.conf @@ -23,3 +23,12 @@ server { } } +server { + listen 80; + server_name pghero.libre-wedding-planner.app.localhost; + + location / { + proxy_pass http://pghero:8080; + proxy_set_header Host $http_host; + } +} \ No newline at end of file