Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Dependencies in docker-compose.yml #77

Open
rc9000 opened this issue Dec 24, 2024 · 0 comments
Open

Better Dependencies in docker-compose.yml #77

rc9000 opened this issue Dec 24, 2024 · 0 comments

Comments

@rc9000
Copy link
Member

rc9000 commented Dec 24, 2024

Using service_healthy could prevent a lot of error messages during the schema upgrade phase, as reported in e.g. #73 . Quick experiment:


services:
  netdisco-postgresql:
    image: netdisco/netdisco:latest-postgresql
    hostname: netdisco-postgresql
    volumes:
      - "./netdisco/pgdata:/var/lib/postgresql/data"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U netdisco -d netdisco"]
      interval: 5s
      retries: 20 
      start_period: 30s
      timeout: 10s
      
  netdisco-backend:
    image: netdisco/netdisco:latest-backend
    hostname: netdisco-backend
    init: true
    volumes:
      - "./netdisco/nd-site-local:/home/netdisco/nd-site-local"
      - "./netdisco/config:/home/netdisco/environments"
      - "./netdisco/logs:/home/netdisco/logs"
    environment:
      NETDISCO_DOMAIN:  discover
      NETDISCO_DB_HOST: netdisco-postgresql
    depends_on:
      netdisco-postgresql:
        condition: service_healthy
        restart: true

  netdisco-web:
    image: netdisco/netdisco:latest-web
    hostname: netdisco-web
    init: true
    volumes:
      - "./netdisco/nd-site-local:/home/netdisco/nd-site-local"
      - "./netdisco/config:/home/netdisco/environments"
    environment:
      NETDISCO_DOMAIN:  discover
      NETDISCO_DB_HOST: netdisco-postgresql
      IPV: 4
    ports:
      - "5000:5000"
    depends_on:
      netdisco-postgresql:
        condition: service_healthy
        restart: true

However it also swallows the Postgres output about incompatible major version files (see #76 ) even when doing docker-compose up in the foreground, plus it requires a slightly newer docker-compose. That's why I'd postpone this until after the other PR is established in the wild.

@rc9000 rc9000 changed the title Better Dependencies Better Dependencies in docker-compose.yml Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant