I have Python app that process data and I am running it in Docker. Locally, it is working fine. When I tried for a first time to run on AWS App Runner I needed health check, so I expose 80 port in Dockerfile and install nginx that listen on that port. When I run container locally I can access the nginx homepage. With curl as well. Here is in addition my Dockerfile.
FROM python:3.9
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN apt update && apt install nginx -y
COPY default /etc/nginx/sites-available/default
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 80/tcp
COPY start.sh /start.sh
RUN chmod +x /start.sh
CMD ["/bin/bash", "/start.sh"]type here
I was trying to setup health check in AWS App Runner. I am using TCP check on port 80. For some reasons it is failing all the time.
Here is the setup for AWS App Runner: Source: Private ECR Deployment Settings: Manual Port: 80 Auto Scaling: Default Health Check: TCP (I tried various settings without success) Security: Use an AWS-owned key (no Instance role) Networking: Public access
Could you please give me some suggestions what could be the issue? Thank you in advance!