Can you help me understand why I can't stop my Docker container?
This is my Dockerfile:
FROM python:3.10.4-alpine3.15
ENV PYTHONUNBUFFERED 1
WORKDIR /app
RUN apk update \
&& apk add --no-cache gcc musl-dev postgresql-dev python3-dev libffi-dev \
&& pip install --upgrade pip
COPY ./requirements.txt ./
RUN pip install -r requirements.txt
COPY ./ ./
EXPOSE 8000
ENTRYPOINT ["sh", "docker_init.sh"]
The problem began when I replaced CMD with ENTRYPOINT cause I needed to run some other stuff. This is the docker_init.sh
file:
python manage.py migrate
python manage.py init_admin
python manage.py runserver 0.0.0.0:8000
Now, I can't stop the Docker container with Ctrl+C. I need to close the terminal, stop Docker and restart it (I'm using Linux).