0

I had working an API, with redis and rq each in one container. I wanted to implement another API, and since they are not very intensely used, I thought they could share the redis and the rq.

In the docker compose I configured the second API to use another port, and everything seemed online and working.

The first API works as before, but when I call the second one, i get: | AttributeError: module 'config' has no attribute ''.

And the related questions don't help me. Am I doing something wrong? Is it possible what i want to do?

Docker-compose:

version: "3.7"

services:
  api1:
    build: .
    image: master-image
    ports:
      - 5000:5000
    command: python3 processes.py
    networks:
      - redis
    environment:
      - REDISHOST=redis
      - FLASK_DEBUG=1
      - FLASK_APP=processes.py
    volumes:
      - .:/opt/processes
  api2:
    build: ap2_dir
    image: satagro-image
    ports:
      - 5001:5001
    command: python3 processes.py
    networks:
      - redis
    environment:
      - REDISHOST=redis
      - FLASK_DEBUG=1
      - FLASK_APP=processes.py
    volumes:
      - /api2_dir/:/opt/processes
  worker:
    build: .
    image: master-image
    networks:
    - redis
    command: rq worker high default low --url redis://redis:6379/0
    volumes:
      - .:/opt/processes

  redis:
    image: redis
    networks:
    - redis

networks:
  redis: ~
ImanolUr
  • 348
  • 2
  • 13

0 Answers0