Skip to content

Commit

Permalink
docs: light copyediting: docs/dev/explain-pro-dev-setup.md (openfoodf…
Browse files Browse the repository at this point in the history
  • Loading branch information
pauamma authored and alexgarel committed Mar 24, 2024
1 parent ff497f8 commit adc1cf7
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions docs/dev/explain-pro-dev-setup.md
Expand Up @@ -7,23 +7,23 @@ off is the public facing application (world.openfoodfacts.org)
off-pro is the producers platform (world.pro.openfoodfacts.org)

When we work on the pro platform for development we want:
* off containers to talk between each other, and have their own volumes
* off-pro containers to talk between each other, and, generally, have their own volumes
* minion and backend from both app access to the same postgres database
* off containers to talk to each other, and have their own volumes
* off-pro containers to talk to each other, and, generally, have their own volumes
* minion and backend from both apps to access the same postgres database
(which stores tasks queues)
* off and off-pro backends / minion needs to share some volumes :
* off and off-pro backends / minion needs to share some volumes:
orgs, users ands some files living in podata

Still we would like to avoid having different clone of the repository,
Still we would like to avoid having different clones of the repository,
but we can isolate projects thanks to `COMPOSE_PROJECT_NAME`,
which will prefix containers names, volumes and default network,
thus isolate each projects.

This is achieved by sourcing the .env-pro which setup some environment variables
that will superseed the .env variables.
The main one being setting `COMPOSE_PROJECT_NAME` and `PRODUCERS_PLATFORM`, but also other like `MINION_QUEUE`.
This is achieved by sourcing .env-pro which sets up some environment variables
that will supersede the .env variables.
The main one being setting `COMPOSE_PROJECT_NAME` and `PRODUCERS_PLATFORM`, but also others like `MINION_QUEUE`.

On volume side, we will simply give hard-coded names to volumes
On the volume side, we will simply give hard-coded names to volumes
that should be shared between off and pro platform, thus they will be shared.
Ideally we should not have to share single files but this is a work in progress,
we will live without it as a first approx.
Expand All @@ -35,10 +35,10 @@ In order to achieve that:
* we use profiles, so we won't start postgres in pro docker compose
* we connect `postgres`, `backend` and `minion` services to a shared network, called `minion_db`
Fortunately this works, but note that there is a pitfall:
on `minion_db` network both `backend` services (`off` and `off-pro`) will respond to same name.
on the `minion_db` network both `backend` services (`off` and `off-pro`) will respond to the same name.
For the moment it is not a problem for we don't need to communicate directly
between instances.
If it was, we would have to define custom aliases for those services on the `minion_db` network.
If it were, we would have to define custom aliases for those services on the `minion_db` network.

```
network OFF network PRO network
Expand All @@ -57,4 +57,4 @@ po_default containers minion_db containers po_pro_default
+------frontend | frontend------------+
+------mongodb | mongodb-------------+
| | |
```
```

0 comments on commit adc1cf7

Please sign in to comment.