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