Docker enrtypiont not found on django app with alpine python

This is my Dockerfile:

FROM python:alpine3.17

# Keeps Python from generating .pyc files in the container

# Turns off buffering for easier container logging


# install psycopg2 dependencies
RUN apk update \
    && apk add postgresql-dev gcc python3-dev musl-dev

COPY Pipfile /app
COPY Pipfile.lock /app
RUN pip install pipenv
RUN pipenv install --system

COPY . /app

USER root
RUN chmod +x /app/
ENTRYPOINT ["/app/"]

This is my


# Apply migrations
python migrate --noinput

# Collect static
python collectstatic --no-input --clear

# Start the application
gunicorn grayti_backend.wsgi:application --bind --workers 3

When I run the image docker run -it myapp:latest, this is the output:

exec /app/ no such file or directory

This error occured only when I moved from FROM python:3.10 to FROM python:alpine3.17

I tried the following but didn't work also:

USER root
RUN chmod +x

The answer from Hans Kilian solved my problem. The problem was solved by replacing #!/bin/bash with #!/bin/sh in the file.

Back to Top