I built my docker Django app with Django-cookiecutter ( It makes a bootstrap application that is ready for production). The application works fine on my local machine with no errors. I pushed the production images to AWS ECR and used docker context ecs to deploy the application. The problem I am facing is that it starts creating all the instances and after a while starts deleting them again. I can't figure out where the problem is coming from. I am a beginner in this and I will appreciate any assistance. This is what my YAML file looks like.
version: '3'
volumes:
production_postgres_data: {}
production_postgres_data_backups: {}
production_traefik: {}
services:
django: &django
build:
context: .
dockerfile: ./compose/production/django/Dockerfile
image: public.ecr.aws/t6g1j7b6/image_converter:django
platform: linux/x86_64
depends_on:
- postgres
- redis
env_file:
- ./.envs/.production/.django
- ./.envs/.production/.postgres
command: /start
networks:
- proxy
- default
postgres:
build:
context: .
dockerfile: ./compose/production/postgres/Dockerfile
image: public.ecr.aws/t6g1j7b6/image_converter:postgres
volumes:
- production_postgres_data:/var/lib/postgresql/data:Z
- production_postgres_data_backups:/backups:z
env_file:
- ./.envs/.production/.postgres
traefik:
build:
context: .
dockerfile: ./compose/production/traefik/Dockerfile
image: public.ecr.aws/t6g1j7b6/image_converter:traefik
depends_on:
- django
volumes:
- production_traefik:/etc/traefik/acme
ports:
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"
- "0.0.0.0:5555:5555"
redis:
image: public.ecr.aws/t6g1j7b6/image_converter:redis
celeryworker:
<<: *django
image: public.ecr.aws/t6g1j7b6/image_converter:celeryworker
command: /start-celeryworker
celerybeat:
<<: *django
image: public.ecr.aws/t6g1j7b6/image_converter:celerybeat
command: /start-celerybeat
flower:
<<: *django
image: public.ecr.aws/t6g1j7b6/image_converter:flower
command: /start-flower
networks:
proxy:
Is there any indication on CloudWatch in relation to ECS service, cluster and similar? Also double check the health check on ec2