Docker container for running PyBossa.
Use my docker-compose file to set up a quick and dirty PyBossa environment for evaluation or test purposes.
WARNING: All data will be lost when the container is removed.
If you prefer to run things by hand, this should get you going. Modify the POSTGRES_URL variable accordingly.
-
(One-time) Set up a PostgreSQL database according to the Pybossa install docs or follow the instructions in the Run PostgreSQL in Docker section.
-
(One-time) Create the PyBossa tables in your database.
docker run --rm -it \ -e POSTGRES_URL="postgresql://pybossa:supersecretpassword@db/pybossa" \ jvstein/pybossa \ python cli.py db_create
-
Start the Redis master.
docker run -d --name redis-master redis:3.0-alpine
-
Start Redis Sentinel.
docker run -d --name redis-sentinel \ --link redis-master \ jvstein/redis-sentinel
-
Start the PyBossa background worker.
docker run -d --name pb-worker \ --link redis-master \ --link redis-sentinel \ -e POSTGRES_URL="postgresql://pybossa:supersecretpassword@db/pybossa" \ jvstein/pybossa \ python app_context_rqworker.py scheduled_jobs super high medium low email maintenance
-
Start the PyBossa frontend.
docker run -d --name pybossa \ --link redis-master \ --link redis-sentinel \ -e POSTGRES_URL="postgresql://pybossa:supersecretpassword@db/pybossa" \ -p 8080:8080 \ jvstein/pybossa
I don't recommend running your database in Docker unless you've fully considered the consequences and know how to ensure your data is preserved. However, for simple test purposes, this is adequate.
-
Start PostgreSQL in a container. Change
/tmp/postgres
to a more permanent volume path if you need your data to persist across docker container instances.docker run -d --name pybossa-db \ -e POSTGRES_USER=pybossa \ -e POSTGRES_PASSWORD=supersecretpassword \ -e PGDATA=/data/pgdata \ -v /tmp/postgres:/data \ postgres:9.6-alpine
-
Add
--link pybossa-db:db
to thepb-worker
andpybossa
startup commands.