Docker-compose: no gunicorn while trying to "up" the container

I run into a problem when I try to "load" my container in DigitalOcean env. I have Ubuntu Docker 1.7.1 from 14.04 as a drop of env. The following error has occurred.

mysite | ./docker-entrypoint: line 8: exec: gunicorn: not found

This is my Docker file, where I tried to add the gunicorn setting (apt-get, pip). Unfortunately, but this does not work. I have the same problem with a missed gun 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"] 

In addition, I tried to add the gunicorn configuration to the entry point file, which also did not work, as long as there is no "no gunkerorn module" error. I suppose it would be nice to add it here, but I checked anyway.

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 

Perhaps I need to add the gunicorn installation to bin / install directly (which should be called from the original task), but this can also be found in the requirements.txt file EDITED: I tried adding guns here, and it's still mysite | ./docker-entrypoint: line 8: exec: gunicorn: not found mysite | ./docker-entrypoint: line 8: exec: gunicorn: not found

bin / set

 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 out my requirements .txt https://gist.github.com/alexnodejs/3789b4eb7621687e010b

Maybe someone has already encountered a similar problem with a unicorn? Please advise where I should dig.

+5
source share
1 answer

The main problem that I see is that you are using image: mysitecatalogweb_source for your mysite service and expect to include a fixed bin/install run result that was not actually attached to the mysitecatalogweb_source image - it sits in the container instead, so virtualenv was never created in the second mysite container and therefore is not activated and gunicorn not available. From just the snippet here, you should add the RUN bin/install to your Dockerfile so that the virtual server is configured before trying to use it.

+1
source

All Articles