Ec2 and security group #1361
-
|
Hi don't you think to port 80 must be open ? if yes how do that when create ec2 command? we use by sg on aws but it's container |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
Hey @hasan-yousefi, I missed this discussion. Mapping port to EC2 will be mapped to your host. Algo mapping port 80 will requiere root docker access. Happy discus further what you are looking for. |
Beta Was this translation helpful? Give feedback.
-
|
Security group only allows traffic to reach the EC2 instance. The container still needs to publish its port on the host. Example when creating the EC2 instance: aws ec2 run-instances \
--image-id ami-xxxx \
--instance-type t3.micro \
--security-group-ids sg-2a0fbfad78b5e5e85 \
--subnet-id subnet-xxxxThen run the container with a host port mapping: docker run -p 80:3000 your-imagewhere services:
app:
image: your-image
ports:
- "80:3000"Also check that the app inside the container listens on |
Beta Was this translation helpful? Give feedback.
-
|
thanks alot @hectorvent |
Beta Was this translation helpful? Give feedback.
Issue #1678