I am using Azure App Services and docker-compose for my app deployment. Testing a simple job using Redis(Hosted as an Azure service) and Redis queue worker. Everything runs successfully on my local machine, but the job fails when I deploy it to App services using docker-compose. After debugging, I have found out the issue to be related to one of the docker-composes service not starting. Azure App services contain 3 tasks of: docker, build and push to ACR. The image gets successfully built and exported to ACR. Only one of the services ('web service') runs, which I believe is referencing the Dockerfile. The other service also uses the image, but is not running.
Build pipeline in App Services:
Release pipeline in App Services:
I've even changed the timeout options in the redis connection parameter for health checks and enabled retries on timeouts. Also, since App Services does not contain support for SSH in web-apps with multiple-containers, it's getting really hard for me to debug what exactly is the issue over here.
docker-compose.yml:
version: '3'
services:
web:
build: . #builds from dockerfile in current directory
image: acr_image
# container_name: web
command: python -u main.py
ports:
- "8000:8000" #mapping the port inside the container to your actual host. Same as in main.py
depends_on:
- worker
links:
- worker
networks:
- redisnet
worker:
build: .
image: acr_image
command: python -u worker.py
ports:
- "6380:6380"
networks:
- redisnet
networks:
redisnet:
worker.py:
redis1 = redis_conn_name
if name == 'main':
with Connection(redis1):
worker = Worker(map(Queue, listen))
worker.work()