Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

I am not quite sure how to setup networks in docker-compose.yml for Postgres and Adminer. All examples I can find are about Postgres and Adminer in same docker-compose.yml meaning separate Adminer for each app, and I dont want that, I want single Adminer for entire VPS instance.
I have another docker-compose.yml with Traefik and Portainer, and I want to add Adminer in that file but I am not sure how to set up networks.
I am aware that with Adminer I can connect to any database with IP, but since this is same VPS I guess Adminer can read hostname trough Docker network.
I have proxy external network that Traefik uses to discover containers. I assume I can’t have Adminer and Postgres on same internal network since they aren’t defined in same container.
Note that I need Postgres to be available for connections from external servers as I will use it’s connection string in Github actions for building the app container, Next.js app needs to read data to prerender pages.
Do you have advice or example how to setup networks? Here is my incomplete setup so far:
docker-compose.yml for reverse proxy in which I want to add Adminer
services:
traefik:
image: "traefik:v2.5.6"
networks:
- proxy
...
adminer:
image: adminer:4.8.1-standalone
networks:
- proxy
labels:
- "traefik.http.routers.adminer.rule=Host(`adminer.${DOMAIN}`)"
- "traefik.http.services.adminer.loadbalancer.server.port=8080"
networks:
proxy:
external: true
docker-compose.yml for my app, Adminer should connect to this Postgres container
app:
depends_on:
- postgres-db-prod
...
networks:
- proxy
- internal
postgres-db-prod:
image: postgres:14-alpine
container_name: postgres-db-prod
restart: unless-stopped
ports:
- 5432:5432
volumes:
- ./prisma/pg-data:/var/lib/postgresql/data
env_file:
- .env.local
labels:
- 'traefik.enable=false'
networks:
- proxy
- internal
networks:
proxy:
external: true
internal:
external: false
d1dd3d9538cc4d06b53e6d1d338d3f
50ff4e4b3c6c4999a12403b1ecda95
a6309a057c3f4cb38fb2e7feb67236
72e571841e7f4a6881090a2f3e93c0
7ce6bf277bff4d429ba493dd750e35
57a72a98162f46a5a5cd04d9b
Thomas Brocken
11575c6d695643cdb40ad47d0f1aea
tez.saad
keneucker
keneucker