Describe the bug
Docker Compose fails to start service and constantly restarts
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The service starts successfully and accepts connections
docker-compose.yml
version: '3.1'
services:
local-data-api:
image: koxudaxi/local-data-api
restart: always
environment:
ENGINE: PostgresSQLJDBC
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: secret
RESOURCE_ARN: 'arn:aws:rds:us-east-1:123456789012:cluster:dummy'
SECRET_ARN: 'arn:aws:secretsmanager:us-east-1:123456789012:secret:dummy'
ports:
- '8080:80'
db:
image: mdillon/postgis
restart: always
environment:
POSTGRES_PASSWORD: secret
POSTGRES_DB: dev
ports:
- '5432:5432'
Error Messages
local-data-api_1 | [2020-11-08 11:06:34 +0000] [1] [INFO] Starting gunicorn 20.0.4
local-data-api_1 | [2020-11-08 11:06:34 +0000] [1] [INFO] Listening at: http://0.0.0.0:80 (1)
local-data-api_1 | [2020-11-08 11:06:34 +0000] [1] [INFO] Using worker: uvicorn.workers.UvicornWorker
local-data-api_1 | [2020-11-08 11:06:34 +0000] [7] [INFO] Booting worker with pid: 7
local-data-api_1 | [2020-11-08 11:06:34 +0000] [7] [ERROR] Exception in worker process
local-data-api_1 | Traceback (most recent call last):
local-data-api_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
local-data-api_1 | worker.init_process()
local-data-api_1 | File "/usr/local/lib/python3.8/site-packages/uvicorn/workers.py", line 57, in init_process
local-data-api_1 | super(UvicornWorker, self).init_process()
local-data-api_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process
local-data-api_1 | self.load_wsgi()
local-data-api_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
local-data-api_1 | self.wsgi = self.app.wsgi()
local-data-api_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
local-data-api_1 | self.callable = self.load()
local-data-api_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
local-data-api_1 | return self.load_wsgiapp()
local-data-api_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
local-data-api_1 | return util.import_app(self.app_uri)
local-data-api_1 | File "/usr/local/lib/python3.8/site-packages/gunicorn/util.py", line 358, in import_app
local-data-api_1 | mod = importlib.import_module(module)
local-data-api_1 | File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
local-data-api_1 | return _bootstrap._gcd_import(name[level:], package, level)
local-data-api_1 | File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
local-data-api_1 | File "<frozen importlib._bootstrap>", line 991, in _find_and_load
local-data-api_1 | File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
local-data-api_1 | File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
local-data-api_1 | File "<frozen importlib._bootstrap_external>", line 783, in exec_module
local-data-api_1 | File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
local-data-api_1 | File "/app/local_data_api/main.py", line 28, in <module>
local-data-api_1 | setup()
local-data-api_1 | File "/app/local_data_api/settings.py", line 58, in setup
local-data-api_1 | raise NotImplementedError("Engine not already implemented")
local-data-api_1 | NotImplementedError: Engine not already implemented
local-data-api_1 | [2020-11-08 11:06:34 +0000] [7] [INFO] Worker exiting (pid: 7)
local-data-api_1 | {"loglevel": "info", "workers": 1, "bind": "0.0.0.0:80", "graceful_timeout": 120, "timeout": 120, "keepalive": 5, "errorlog": "-", "accesslog": "-", "workers_per_core": 1.0, "use_max_workers": null, "host": "0.0.0.0", "port": "80"}
local-data-api_1 | [2020-11-08 11:06:34 +0000] [1] [INFO] Shutting down: Master
local-data-api_1 | [2020-11-08 11:06:34 +0000] [1] [INFO] Reason: Worker failed to boot.
local-data-api_1 | {"loglevel": "info", "workers": 1, "bind": "0.0.0.0:80", "graceful_timeout": 120, "timeout": 120, "keepalive": 5, "errorlog": "-", "accesslog": "-", "workers_per_core": 1.0, "use_max_workers": null, "host": "0.0.0.0", "port": "80"}
api_local-data-api_1 exited with code 3
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too