ZohaibRamzan
(Hafiz Muhammad Zohaib)
February 21, 2023, 12:28pm
1
Hi rasa community,
I have deployed my project on EC2 instance using docker file. The Dockerfile is like:
FROM python:3.8-slim-buster WORKDIR /app COPY requirements.txt /app/ RUN pip install --no-cache-dir -r requirements.txt COPY . /app/ EXPOSE 5005 CMD [“rasa”, “run”, “–enable-api”, “-p”, “5005”]
and the requirements.txt file is like:
pandas
openai
rasa
Now the host port 80 is attached to to the container port 5005. I am getting the response on terminal using curl command.
When I post the request on public address of ec2 instance. I am unable to send the request. Although in my security group port 80 is configured to accept http calls. What should I do?
rasa_learner
(sathishlakshmanan)
February 21, 2023, 4:28pm
2
Hi @ZohaibRamzan , can you post the webhook endpoint of the ec2 instance?
rasa_learner
(sathishlakshmanan)
February 21, 2023, 5:38pm
4
Can you try running the server on a port other than 80?
ZohaibRamzan
(Hafiz Muhammad Zohaib)
February 21, 2023, 7:07pm
5
You mean ec2 port. Currently My docker container port 5005 is bind to port 80 of the ec2 instance. What other port should I try to bind with docker port 5005?
rasa_learner
(sathishlakshmanan)
February 21, 2023, 8:10pm
9
When you access ip:port in the browser, do you get the message “Hello from Rasa”?
rasa_learner
(sathishlakshmanan)
February 21, 2023, 8:24pm
12
Then it should be a problem related to security group. Please remove the old SG and create a new SG and attach it to the instance and try again
ZohaibRamzan
(Hafiz Muhammad Zohaib)
February 21, 2023, 8:42pm
13
Deleted old SG and added new SG. still not resolved
rasa_learner
(sathishlakshmanan)
February 21, 2023, 8:54pm
14
Can you share your docker-compose/Dockerfile?
ZohaibRamzan
(Hafiz Muhammad Zohaib)
February 21, 2023, 8:58pm
15
FROM python:3.8-slim-buster
WORKDIR /app
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app/
EXPOSE 5005
CMD [“rasa”, “run”, “–enable-api”, “-p”, “5005”]
The requirements.txt file has three libraries as below
pandas
openai
rasa
The above docker file is being used for image creation and then container.
rasa_learner
(sathishlakshmanan)
February 21, 2023, 9:03pm
16
What’s the docker command
you use to run the container?
ZohaibRamzan
(Hafiz Muhammad Zohaib)
February 21, 2023, 9:05pm
17
Dockerfile (201 Bytes)
sudo docker run -d -p 5005:5005 --name rasa-server image_id
rasa_learner
(sathishlakshmanan)
February 21, 2023, 10:18pm
18
So, the situation is the endpoint is accessible within the instance but not outside the instance, right? In that case, it should be related to the SG!
ZohaibRamzan
(Hafiz Muhammad Zohaib)
February 23, 2023, 10:41am
19
Thanks for your help. The issue was not related to SG. It was port forwarding issue. Which i resolved by running these below two commands.
sysctl net.ipv4.conf.all.forwarding=1, iptables -P FORWARD ACCEPT
ZohaibRamzan
(Hafiz Muhammad Zohaib)
February 23, 2023, 10:43am
20
Now my both rasa server and action server are working and I am able to get the responses through postman. How can I get the rasa widget configured on public IP address to show the client how chatbot is working? kindly help.