Skip to content

Instantly share code, notes, and snippets.

@alexsegura
Last active February 1, 2017 18:02
Show Gist options
  • Save alexsegura/1873264c1ede437852e69783f44adcab to your computer and use it in GitHub Desktop.
Save alexsegura/1873264c1ede437852e69783f44adcab to your computer and use it in GitHub Desktop.
Running Hypothes.is with Docker Compose

Website dev install

Install Docker Compose & VirtualBox.

Clone the Hypothes.is repo and copy the docker-compose.yml file below inside.

Running the databases with Docker.

# Create a Docker machine if needed
docker-machine create --driver virtualbox default

eval $(docker-machine env default)
docker-compose up -d

Running the Python server

virtualenv .venv
source .venv/bin/activate

export DATABASE_URL=postgresql://postgres@`docker-machine ip default`/postgres
export ELASTICSEARCH_HOST=http://`docker-machine ip default`:9200
export BROKER_URL=amqp://guest:guest@`docker-machine ip default`:5672//

# Server will run on localhost:5000
make dev

Adding an admin user

bin/hypothesis --dev user add
bin/hypothesis --dev user admin admin

Making an API call

Log in with your user credentials an obtain an API token.

curl -H 'Authorization: Bearer <API_TOKEN>' http://localhost:5000/api/
version: '2'
services:
postgres:
image: postgres
ports:
- "5432:5432"
expose:
- "5432"
elasticsearch:
image: nickstenning/elasticsearch-icu
ports:
- "9200:9200"
- "9300:9300"
expose:
- "9200"
- "9300"
rabbitmq:
image: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
expose:
- "15672"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment