0

I am unable to run a Docker container with a gunicorn entrypoint. I receive the error:

gunicorn_1  | /entrypoint.sh: 46: exec: gunicorn: not found

I'm building the docker images (gunicorn + nginx), hosting in a container registry and then pulling the image. I receive the error when I run docker-compose up on the server.

Dockerfile (gunicorn):

FROM python:3.9.5-slim-buster

WORKDIR /usr/src/app

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

RUN pip install --upgrade pip
COPY ./requirements.txt /usr/src/app/requirements.txt
RUN pip install -r /usr/src/app/requirements.txt

COPY . /usr/src/app/

EXPOSE 8000

Dockerfile (nginx):

FROM nginx:1.19-alpine

RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d

Docker-compose:

version: '2'
services:
    gunicorn:
        image: link_to_built_gunicorn_image
        command: gunicorn --bind 0.0.0.0:8000 wsgi:app
        ports:
          - 8000:8000
    nginx:
      image: link_to_built_nginx_image
      ports:
        - 80:80
      depends_on:
        - gunicorn

Requirements.txt:

Flask
oauthlib
pyOpenSSL
gunicorn

I've looked at similar posts (1, 2 and 3) and checked the following:

  • gunicorn is included in the requirements.txt
  • Tried downgrading gunicorn version in requirements.txt

Additional information:

  • Ubuntu 20.04.3 LTS OS hosted with Digital Ocean
Calum
  • 104
  • 11
  • Your error message mentions an `entrypoint.sh` script. Is that part of the setup somewhere? – David Maze Oct 13 '21 at 10:48
  • I don't have any reference to it in either my Dockerfiles or docker-compose file. I'm using `command` in my docker-compose to start gunicorn – Calum Oct 13 '21 at 13:31

0 Answers0