I have a Django project file and Docker in Ubuntu server.And when I build docker image, it creates well.But when I up this image, 'python: 1: ./AA/entrypoint.sh: not found' error occurred.
My Dockerfile
is
FROM python:3.10.11WORKDIR /usr/src/app/serverENV PYTHONDONTWRITEBYTECODE 1ENV PYTHONUNBUFFERED 1RUN apt-get -y update \&& apt-get install -y postgresql postgresql-contrib \ libpq-dev \ gcc \ python3-dev \ musl-devRUN pip install --upgrade pipCOPY ./requirements.txt .RUN pip install -r requirements.txtCOPY . .ENTRYPOINT ["sh", "-c", "./AA/entrypoint.sh"]
My entrypoint.sh
is
#!/bin/shif [ "$DATABASE" = "postgres" ]then echo "Wating for postgres..." while ! nc -z $DB_HOST $DB_PORT; do sleep 0.1 done echo "POSTGRESQL started"fipython manage.py flush --no-inputpython manage.py migrateexec "$@"
And the structure of files is...
In /usr/src/app/server/AA/, -> Django projects by git clone -> Dockerfile -> docker-compose.yml -> entrypoint.sh
I tried these codes in Dockerfile
, but all have same error.
ENTRYPOINT ["entrypoint.sh"]ENTRYPOINT ["sh", "-c", "./entrypoint.sh"]ENTRYPOINT ["sh", "-c", "./AA/entrypoint.sh"]ENTRYPOINT ["sh", "-c", "/usr/src/app/server/AA/entrypoint.sh"]