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

nginx config requires base service name to be app #81

Open
Pingumania opened this issue Mar 7, 2021 · 0 comments
Open

nginx config requires base service name to be app #81

Pingumania opened this issue Mar 7, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@Pingumania
Copy link

I have multiple services in one docker-compose file, for easier readability I renamed blackcandy from app to blackcandy.

blackcandy: &blackcandy_base
    image: blackcandy/blackcandy
    container_name: blackcandy_app
    networks:
      - internal
    volumes:
      - /mnt/share/audio/musik:/media_data:ro
      # - production_uploads_data:/app/public/uploads
    environment:
      DB_HOST: blackcandy_postgres
      DB_USER: postgres
      REDIS_CACHE_URL: redis://blackcandy_redis:6379/1
      REDIS_SIDEKIQ_URL: redis://blackcandy_redis:6379/2
      MEDIA_PATH: /media_data
    depends_on:
      - blackcandy_postgres
      - blackcandy_redis

  blackcandy_postgres:
    image: postgres:11.1-alpine
    container_name: blackcandy_postgres
    networks:
      - internal
    volumes:
      - $DOCKERDIR/postgres/blackcandy:/var/lib/postgresql/data

  blackcandy_redis:
    container_name: blackcandy_redis
    networks:
      - internal
    image: redis:4.0-alpine

  blackcandy_worker:
    <<: *blackcandy_base
    container_name: blackcandy_worker
    command: bundle exec sidekiq

  blackcandy_web:
    <<: *blackcandy_base
    container_name: blackcandy_web
    networks:
      - internal
      - proxy
    depends_on:
      - blackcandy
      - blackcandy_worker
    command: nginx -g 'pid /tmp/nginx.pid; daemon off;'
    labels:
      traefik.enable: true
      traefik.http.routers.blackcandy.entrypoints: web-secure
      traefik.http.routers.blackcandy.rule: Host(`blackcandy.$DOMAINNAME`)
      traefik.http.services.blackcandy.loadbalancer.server.port: 80
      traefik.http.services.blackcandy.loadbalancer.server.scheme: http

Here is the error I get:

mb@dockerhost:~$ docker logs blackcandy_web
nginx: [emerg] host not found in upstream "app:3000" in /etc/nginx/nginx.conf:19

Not a huge deal but maybe we can change this via an environment variable?

@aidewoode aidewoode added the enhancement New feature or request label Dec 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants