I am trying to run a django application inside of a docker container (ECS - Fargate)
However, I am having trouble figuring out how to run multiple commands in the Command
section of a task definition, currently it is configured like this
Howevery my containers keep on STOPPING
and I cant even see the logs in CloudWatch
How do I get it to execute properly?, any help is highly appreciated
In your case I would do this by using /bin/sh -c
despite the entry point:
/bin/sh -c "python manage.py ... <and the rest>"
This is also how it is done in the offical AWS ECS tutorial:
"entryPoint": [
"sh",
"-c"
],
"command": [
"/bin/sh -c \"echo '<html> <head> <title>Amazon ECS Sample App</title> <style>body {margin-top: 40px; background-color: #333;} </style> </head><body> <div style=color:white;text-align:center> <h1>Amazon ECS Sample App</h1> <h2>Congratulations!</h2> <p>Your application is now running on a container in Amazon ECS.</p> </div></body></html>' > /usr/local/apache2/htdocs/index.html && httpd-foreground\""
]