I need to run a docker container in AWS ECS. I do NOT have access to the source code for the image. This is a private image, from a private repo that I have uploaded to AWS ECR. I have created an AWS ECS Task Definition to run the container inside a service, inside a cluster. The image shows as being up and running but I cannot hit it via my browser. I know that all the network settings are correct because I can hit a simple hello world
app that I also deployed to test.
There is also a command I need to run before: docker run --env-file <environment_variables_file> <image>:<tag> rake db:reset && rake db:seed
.
According to the instructions for this docker image, the run command for it is: docker run -d --name <my_image_name> --env-file <environment_variables_file> -p 8080:80 <image>:<tag>
.
I can run this image locally on my laptop with no issues, deploying it to AWS is that problem.
My question is how do I provide the environment_variables_file
to the image? Where do I upload the file and how do I pass it? How do I run the command to init the DB before the image runs?