foundationdb/packaging/docker/samples/python
John Brownlee eba2b4528e Use an older FDB library in the python sample app to support testing upgrades from 6.1 to 6.2. 2020-02-01 17:51:54 -08:00
..
app Use an older FDB library in the python sample app to support testing upgrades from 6.1 to 6.2. 2020-02-01 17:51:54 -08:00
.env Fix python sample using docker-compose 2019-12-14 15:25:33 +01:00
README.md Add additional client libraries to the sample python app to show how to prepare for upgrades. 2020-01-29 12:05:37 -08:00
docker-compose.yml Fix python sample using docker-compose 2019-12-14 15:25:33 +01:00

README.md

Python sample using docker-compose

This contains a sample docker-compose.yaml to run a simple Python application running with FoundationDB as a storage backend.

All variables are located in .env file.

Start the Python demo

docker-compose up -d

This will start:

  • 1 coordinator,
  • 2 fdbservers,
  • 1 Flask application.

The Flask application can be accessed using curl:

# retrieve counter
curl http://0.0.0.0:5000/counter # 0

# increment counter
curl -X POST http://0.0.0.0:5000/counter/increment # 1
curl -X POST http://0.0.0.0:5000/counter/increment # 2

# retrieve counter
curl http://0.0.0.0:5000/counter # 2

Access the FoundationDB cluster

If you want to access the cluster from your machine, here's a cluster file ready for you:

echo "docker:docker@127.0.0.1:4500" > docker.cluster
FDB_CLUSTER_FILE=./docker.cluster fdbcli

Stop the Python demo

docker-compose down

Use outside of docker-compose

The client application is also available as a standalone image: foundationdb/foundationdb-sample-python-app:latest.