hackoregon / backend-examplar-2018

an example dockerized geo-aware django backend
MIT License
4 stars 5 forks source link

Does the DOCKERFILE.api.production require an ENTRYPOINT for when these containers are launched from images in ECS? #64

Closed MikeTheCanuck closed 6 years ago

MikeTheCanuck commented 6 years ago

Last year's DOCKERFILEs all specified an ENTRYPOINT script, and if I remember correctly they're there because otherwise, once the container image gets pulled into ECS and is run on its own, there's nothing there to start the actual API runner and the container just hangs/goes zombie.

bhgrant8 commented 6 years ago

We specify the entrypoint in the docker-compose files under the command: https://github.com/hackoregon/backend-examplar-2018/blob/staging/production-docker-compose.yml#L8

this is going to override anything in the Dockerfile, but I maybe missing something in how ECS starts tasks, if they don't read the docker-compose, then this could be an issue? don't think it would harm anything to add it in.

MikeTheCanuck commented 6 years ago

Scarring memories are coming back to me - all startup using docker-compose in the Travis environment will work fine, but when the container image is published, then deployed to ECS and finally launched by ECS, there is no docker-compose in use - only bare docker commands such as docker run (AFAIK). Without the ENTRYPOINT script in DOCKERFILE, the container is dead in the water, and will never successfully deploy (since ALB will consider it "dead").

We got bit by this last year for a while. I felt like a right moron once Dan explained it to me.

nam20485 commented 6 years ago

I believe ENTRYPOINT values were added to the DOCKERFILE.* in another commit.

Looks like an ENTRYPOINT value was added to DOCKERFILE.api.production (see referenced issue) https://github.com/hackoregon/backend-examplar-2018/blob/f14dc25f5e4745bde570f280d57f6d987ac2bfa7/DOCKERFILE.api.production#L26 which solved the issue that Mike mentioned above, but not for DOCKERFILE.api.development or DOCKERFILE.db.development.

Do we need ENTRYPOINT values in the DOCKERFILE.*.development dockerfiles, or is this issue now resolved?

khashf commented 6 years ago

@nam20485: PR made at #87 to add ENTRYPOINT for DOCKERFILE.api.development file since I need it. Just did on my local machine and my CloudFormation stack is not stuck anymore. Confirm that if this ENTRYPOINT is missing, container cannot start and ECS::Service will hang.

nam20485 commented 6 years ago

Closing. This change was merged in with PR #87