I'm facing with issue when I try to "up" my container on DigitalOcean env. I have Ubuntu Docker 1.7.1 on 14.04 as env droplet. There is the next error.
mysite | ./docker-entrypoint: line 8: exec: gunicorn: not found
This is my Dockerfile where I tried to add gunicorn setup by (apt-get, pip). Sadly but it doesn't work I have the same issue with missed gunicorn module.
Dockerfile
FROM python:2.7.7
RUN curl -sL https://deb.nodesource.com/setup | bash -
RUN apt-get -y install nodejs
RUN apt-get -y install libpango1.0-0 libgdk-pixbuf2.0-0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app
VOLUME /usr/src/app/venv
VOLUME /usr/src/app/node_modules
VOLUME /usr/src/app/static
ENTRYPOINT ["./docker-entrypoint"]
Additionally I tried to add gunicorn setup to the entry point file which also didn't work there is "no gunicorn module" error still. I guess it wasn't a great idea to add it here but anyway I've checked.
Docker entry point
#!/bin/bash
set -e
if [[ -e venv/bin/activate ]]; then
source venv/bin/activate
fi
exec "$@"
docker-compose.yml
source:
extends:
file: docker-compose-common.yml
service: prod
build: .
command: bin/install
redis:
image: redis:latest
command: redis-server --appendonly yes
mysite:
extends:
file: docker-compose-common.yml
service: prod
image: mysitecatalogweb_source
volumes_from:
- source
environment:
- SITE_ID=1
command: gunicorn -k gevent -b 0.0.0.0:8000 --access-logfile - --error-logfile - mysite.wsgi
docker-compose-common.yml
dev:
environment:
- PYTHONUNBUFFERED=1
- ENV=DEV
- POSTGRES_HOST=host
- POSTGRES_USER=user
env_file: dev.env
prod:
environment:
- ENV=PROD
env_file: prod.env
Maybe I need to add gunicorn setup to the bin/install directly (which should be called from source task) but this is also can be found in the requirements.txt EDITED: I've tried to add gunicorn here and it is still
mysite | ./docker-entrypoint: line 8: exec: gunicorn: not found
bin/install
set -e
pip install virtualenv
if [[ ! -e venv/bin/activate ]]; then
virtualenv venv
source venv/bin/activate
fi
pip install -r requirements.txt
mkdir -p static/js
npm install
npm run browserify
Also check my requirements.txt https://gist.github.com/alexnodejs/3789b4eb7621687e010b
Maybe someone already bumped with similar issue with unicorn? Please advise where I should dig.
mysite
service, you are using the image of thesource
service... I've never seen this kind of configuration. What is the reason to do that? You should be able to install gunicorn usingRUN pip install gunicorn
in the Dockerfile. Sorry if it is a silly question, but did you rundocker-compose build
before to usedocker-compose up
?docker-compose -f docker-compose-prod.yml build
beforeup
RUN pip install gunicorn
to the Docker file and rebuild the project, maybe I did something wrong.docker-compose build
fixed it for me. Thanks!