I'm attempting to deploy a PHP application using AWS Lightsail container service but encountering a port-related error during deployment. The command and error message are as follows:
aws lightsail create-container-service-deployment --service-name smileclass-container-service-1 --containers '{"smileclass-web-container":{"image":"smileclass-container-service-1.smileclass.21"}}' --public-endpoint '{"containerName":"smileclass-web-container","containerPort":80,"healthCheck":{"path":"/"}}'
Error Message:
InvalidInputException: Invalid port specified. You must specify a port that is in the list of ports of the specified container.
The Dockerfile exposes ports 80 and 443, matching the port configuration in Lightsail. The build and image push are successful, and there's no mistake in the image name. What could be the cause of this error?