Skip to content

Allow internal connections between compose and applications by default #2558

@robgraeber

Description

@robgraeber

What problem will this feature address?

I setup postgres via compose and I'm trying to connect it to an application via internal url. However the application can't find it and I'm not sure if I need to add dokploy-network or something else to the compose file.

Compose file:

services:
  db:
    image: postgres:17
    container_name: postgres17
    restart: unless-stopped
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB}
    ports:
      - '5432:5432'
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test:
        - CMD-SHELL
        - pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s
    networks:
      - mediacreatorprogrpcstaging-db-01e1ey
    labels:
      - traefik.http.routers.mediacreatorprogrpcstaging-db-01e1ey-23-web.rule=Host(`mediacreatorprogrpcstaging-db-01e1ey-b6b5cb-51-81-35-203.traefik.me`)
      - traefik.http.routers.mediacreatorprogrpcstaging-db-01e1ey-23-web.entrypoints=web
      - traefik.http.services.mediacreatorprogrpcstaging-db-01e1ey-23-web.loadbalancer.server.port=3000
      - traefik.http.routers.mediacreatorprogrpcstaging-db-01e1ey-23-web.service=mediacreatorprogrpcstaging-db-01e1ey-23-web
      - traefik.enable=true
volumes:
  pgdata: null
networks:
  mediacreatorprogrpcstaging-db-01e1ey:
    name: mediacreatorprogrpcstaging-db-01e1ey
    external: true

Describe the solution you'd like

I'm expecting it to work out of the box

Describe alternatives you've considered

I ended up setting the postgres db up as an application which can communicate with other applications. Ultimately I am doing all this as a workaround for custom domain support for databases.

Is adding dokploy-network to the compose file what's missing?

Additional context

No response

Will you send a PR to implement it?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions