Giter Club home page Giter Club logo

docker-readthedocs's Introduction

Readthedocs in Docker

A Docker container of Readthedocs (RTD).

Usage

Run using docker-compose:

  • start a readthedocs container + its dependencies (postgresql, elasticsearch and redis)
$ docker-compose run --service-ports --rm readthedocs
# or
$ make run

Run in debug mode (bash) :

make debug-run
# or
docker run -it --rm --entrypoint=bash moul/readthedocs

License

MIT

docker-readthedocs's People

Contributors

jfroche avatar mlanin avatar moul avatar saily avatar tescalada avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

docker-readthedocs's Issues

The SECRET_KEY setting must not be empty 这个问题怎么解决的

{"error":"IndexAlreadyExistsException[[readthedocs] already exists]","status":400}+ cd /app/readthedocs

  • ln -s ../manage.py .
  • PYTHON=/venv/bin/python
  • /venv/bin/python manage.py syncdb --noinput
    Traceback (most recent call last):
    File "manage.py", line 11, in
    execute_from_command_line(sys.argv)
    File "/venv/local/lib/python2.7/site-packages/django/core/management/init.py", line 353, in execute_from_command_line
    utility.execute()
    File "/venv/local/lib/python2.7/site-packages/django/core/management/init.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/venv/local/lib/python2.7/site-packages/django/core/management/init.py", line 185, in fetch_command
    settings.INSTALLED_APPS
    File "/venv/local/lib/python2.7/site-packages/django/conf/init.py", line 55, in getattr
    self._setup(name)
    File "/venv/local/lib/python2.7/site-packages/django/conf/init.py", line 43, in _setup
    self._wrapped = Settings(settings_module)
    File "/venv/local/lib/python2.7/site-packages/django/conf/init.py", line 120, in init
    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
    django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
  • /venv/bin/python manage.py migrate
    Traceback (most recent call last):
    File "manage.py", line 11, in
    execute_from_command_line(sys.argv)
    File "/venv/local/lib/python2.7/site-packages/django/core/management/init.py", line 353, in execute_from_command_line
    utility.execute()
    File "/venv/local/lib/python2.7/site-packages/django/core/management/init.py", line 345, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/venv/local/lib/python2.7/site-packages/django/core/management/init.py", line 195, in fetch_command
    klass = load_command_class(app_name, subcommand)
    File "/venv/local/lib/python2.7/site-packages/django/core/management/init.py", line 39, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
    File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
    import(name)
    File "/venv/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 16, in
    from django.db.migrations.autodetector import MigrationAutodetector
    File "/venv/local/lib/python2.7/site-packages/django/db/migrations/autodetector.py", line 14, in
    from django.db.migrations.questioner import MigrationQuestioner
    File "/venv/local/lib/python2.7/site-packages/django/db/migrations/questioner.py", line 12, in
    from .loader import MigrationLoader
    File "/venv/local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 10, in
    from django.db.migrations.recorder import MigrationRecorder
    File "/venv/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 12, in
    class MigrationRecorder(object):
    File "/venv/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 26, in MigrationRecorder
    class Migration(models.Model):
    File "/venv/local/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 27, in Migration
    app = models.CharField(max_length=255)
    File "/venv/local/lib/python2.7/site-packages/django/db/models/fields/init.py", line 1072, in init
    super(CharField, self).init(*args, **kwargs)
    File "/venv/local/lib/python2.7/site-packages/django/db/models/fields/init.py", line 166, in init
    self.db_tablespace = db_tablespace or settings.DEFAULT_INDEX_TABLESPACE
    File "/venv/local/lib/python2.7/site-packages/django/conf/init.py", line 55, in getattr
    self._setup(name)
    File "/venv/local/lib/python2.7/site-packages/django/conf/init.py", line 43, in _setup
    self._wrapped = Settings(settings_module)
    File "/venv/local/lib/python2.7/site-packages/django/conf/init.py", line 120, in init
    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
    django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

Does not Run

It looks like this container does not work correctly any more. Attempting to do a make run results in the following:

+ PYTHON=/venv/bin/python
+ /venv/bin/python manage.py syncdb --noinput
/venv/bin/python: can't open file 'manage.py': [Errno 2] No such file or directory
+ /venv/bin/python manage.py migrate
/venv/bin/python: can't open file 'manage.py': [Errno 2] No such file or directory
+ /venv/bin/python manage.py shell
+ echo 'from django.contrib.auth.models import User; User.objects.create_superuser('\''admin'\'', '\''admin@localhost'\'', '\''admin'\'')'
/venv/bin/python: can't open file 'manage.py': [Errno 2] No such file or directory
+ /venv/bin/python manage.py loaddata test_data
/venv/bin/python: can't open file 'manage.py': [Errno 2] No such file or directory
+ /venv/bin/python manage.py makemessages --all
/venv/bin/python: can't open file 'manage.py': [Errno 2] No such file or directory
+ /venv/bin/python manage.py compilemessages
/venv/bin/python: can't open file 'manage.py': [Errno 2] No such file or directory
+ /venv/bin/python manage.py celeryd -l INFO
+ /venv/bin/python manage.py runserver 0.0.0.0:8000
/venv/bin/python: can't open file 'manage.py': [Errno 2] No such file or directory
/venv/bin/python: can't open file 'manage.py': [Errno 2] No such file or directory
make: *** [run] Error 2

Then abruptly stops.

Wrong Path in rtd-start

I've tried with pulling the image from index and by building one myself I get the same error:

dev@ubuntu:~/docker-readthedocs$ sudo docker run -p 127.0.0.1:54545:8000 readthedocs:latest /bin/sh -e /bin/rtd-start.sh
-su: line 0: cd: /home/py/app: No such file or directory
-su: /home/py/venv/bin/python: No such file or directory

Path in rtd-start seems to be wrong

Import not working :: Redis Error

After got it running I get this here when I want to import a repo:

[27/Feb/2014 03:29:15] ERROR [projects.tasks:679] (Build) [docker-readthedocs:latest] Failed to symlink cnames, Redis error. 
Traceback (most recent call last): 
File "readthedocs/projects/tasks.py", line 677, in symlink_cnames 
cnames = redis_conn.smembers('rtd_slug:v1:%s' % version.project.slug) 
File "/venv/local/lib/python2.7/site-packages/redis/client.py", line 974, in smembers 
return self.execute_command('SMEMBERS', name) 
File "/venv/local/lib/python2.7/site-packages/redis/client.py", line 363, in execute_command 
connection.send_command(*args) 
File "/venv/local/lib/python2.7/site-packages/redis/connection.py", line 299, in send_command 
self.send_packed_command(self.pack_command(*args)) 
File "/venv/local/lib/python2.7/site-packages/redis/connection.py", line 281, in send_packed_command 
self.connect() 
File "/venv/local/lib/python2.7/site-packages/redis/connection.py", line 229, in connect 
raise ConnectionError(self._error_message(e)) 
ConnectionError: Error 111 connecting localhost:6379. Connection refused. 

config question

Hello,

I've been looking at your image and have a question. In the Dockerfile you copy: config to: /

and set ENV DJANGO_SETTINGS_MODULE config .

When I try to build from scratch I get :

ImportError: Could not import settings 'config' (Is it on sys.path? Is there an import error in the settings file?): No module named config

Strangely your image (on the docker hub), does not have the /config directory in / but still has the DJANGO_SETTINGS_MODULE=config environment variable set.

Am I missing something or did you later delete the /config directory?

Thanks
Chris

Missing Dockerfile

docker-compose fails with "Missing Dockerfile" as shown below:

$ sudo docker-compose run --service-ports --rm readthedocs
Pulling db (sameersbn/postgresql:9.1-1)...
9.1-1: Pulling from sameersbn/postgresql
a3ed95caeb02: Pull complete
3fb9964802bf: Pull complete
4b70f00f1250: Pull complete
6d1b40e89a6f: Pull complete
e1137a2d4301: Pull complete
adf75a814e6b: Pull complete
fd0107fe8768: Pull complete
d72613fec2ef: Pull complete
b7b8cdd7520a: Pull complete
Digest: sha256:23d07bafe1661c8b581ecc4ec00f48bd684d118ab9eadbccb198cb7380eaf964
Status: Downloaded newer image for sameersbn/postgresql:9.1-1
Pulling elasticsearch (jfroche/elasticsearch:)...
latest: Pulling from jfroche/elasticsearch
a3ed95caeb02: Pull complete
8cec72ef32a5: Pull complete
b5d0abe18dec: Pull complete
c2efe7d13661: Pull complete
83abbc5bee98: Pull complete
6e08bdf2c205: Pull complete
5208f9387fac: Pull complete
7a62a599a192: Pull complete
3fb6f43f8aa1: Pull complete
f3275e1efee5: Pull complete
53c19081779d: Pull complete
c6aa7df0be3b: Pull complete
aac098799706: Pull complete
Digest: sha256:dfde4a4e890746e0e8183c286a2104142e1ece6f919fd93b06127b0b7e80289e
Status: Downloaded newer image for jfroche/elasticsearch:latest
Pulling redis (redis:)...
latest: Pulling from library/redis
1ab2bdfe9778: Pull complete
966bc436cc8b: Pull complete
c1b01f4f76d9: Pull complete
8a9a85c968a2: Pull complete
8e4f9890211f: Pull complete
93e8c2071125: Pull complete
Digest: sha256:9755880356c4ced4ff7745bafe620f0b63dd17747caedba72504ef7bac882089
Status: Downloaded newer image for redis:latest
Creating readthedocs_redis_1 ... done
Creating readthedocs_elasticsearch_1 ... done
Creating readthedocs_db_1 ... done
Building readthedocs
ERROR: Cannot locate specified Dockerfile: Dockerfile

ImportError: No module named docker

I tried running docker-readthedocs, but it looks like a docker related dependency is missing. I'm new to RTD, and hence I can't easily say how far off the Dockerfile in moul/docker-readthedocs is from building successfully.

Commands to reproduce the problem:

git clone https://github.com/moul/docker-readthedocs.git 
docker-compose run --service-ports --rm readthedocs

Here is the "tail" of the build log with the error message:

....
Step 21 : CMD /bin/rtd-start.sh
 ---> Running in e79da91191db
 ---> 4df232adf658
Removing intermediate container e79da91191db
Successfully built 4df232adf658
+ curl -XPUT http://elasticsearch:9200/readthedocs/
{"acknowledged":true}+ cd /app/readthedocs
+ ln -s ../manage.py .
+ PYTHON=/venv/bin/python
+ /venv/bin/python manage.py syncdb --noinput
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/readthedocs/config.py", line 1, in <module>
    from readthedocs.settings.docker import *
ImportError: No module named docker
+ /venv/bin/python manage.py migrate
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/readthedocs/config.py", line 1, in <module>
    from readthedocs.settings.docker import *
ImportError: No module named docker
+ echo 'from django.contrib.auth.models import User; User.objects.create_superuser('\''admin'\'', '\''admin@localhost'\'', '\''admin'\'')'
+ /venv/bin/python manage.py shell
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/readthedocs/config.py", line 1, in <module>
    from readthedocs.settings.docker import *
ImportError: No module named docker
+ /venv/bin/python manage.py loaddata test_data
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/readthedocs/config.py", line 1, in <module>
    from readthedocs.settings.docker import *
ImportError: No module named docker
+ /venv/bin/python manage.py makemessages --all
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/readthedocs/config.py", line 1, in <module>
    from readthedocs.settings.docker import *
ImportError: No module named docker
+ /venv/bin/python manage.py compilemessages
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/readthedocs/config.py", line 1, in <module>
    from readthedocs.settings.docker import *
ImportError: No module named docker
+ /venv/bin/python manage.py runserver 0.0.0.0:8000
+ /venv/bin/python manage.py celeryd -l INFO
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/readthedocs/config.py", line 1, in <module>
    from readthedocs.settings.docker import *
ImportError: No module named docker
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/readthedocs/config.py", line 1, in <module>
    from readthedocs.settings.docker import *
ImportError: No module named docker

Functionality lmited

i do a make build, make run then login as admin. If I add a project manually that I know to build properly on the public readthedocs it adds the project but the build remains in the "Triggered" state...is celery not functioning?

ImportError: No module named sqlite

I followed the instructions but when the docker-compose gets to the point of running this application, it fails with this trace:

+ /venv/bin/python manage.py syncdb --noinput
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/venv/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 303, in execute
    settings.INSTALLED_APPS
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__
    self._setup(name)
   File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup
    self._wrapped = Settings(settings_module)
  File "/venv/local/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/app/readthedocs/config.py", line 1, in <module>
    from readthedocs.settings.sqlite import *
ImportError: No module named sqlite

`

It looks like 5 days ago there was a commit on the rtd repo to change the settings, specifically on line 6 of the manage.py file.

Disable email verification

Trying to prop this system up.

However, the default user admin/admin requires email verification, and it would appear that email is not setup.

What is the solution to logging in without an email server?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.