Skip to content

Commit

Permalink
Clarify container setup and restart process in Docker tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
briskdust committed Nov 8, 2023
1 parent 2c2ad3d commit 9df7cb6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions documentation/tut/toy-example-setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,18 @@ Install Flexmeasures and the database
$ docker pull lfenergy/flexmeasures:latest
$ docker pull postgres
$ docker network create flexmeasures_network
After running these commands, we can start the Postgres database and the FlexMeasures app with the following commands:

.. code-block:: bash
$ docker run --rm --name flexmeasures-tutorial-db -e POSTGRES_PASSWORD=fm-db-passwd -e POSTGRES_DB=flexmeasures-db -d --network=flexmeasures_network postgres:latest
$ docker run --rm --name flexmeasures-tutorial-fm --env SQLALCHEMY_DATABASE_URI=postgresql://postgres:fm-db-passwd@flexmeasures-tutorial-db:5432/flexmeasures-db --env SECRET_KEY=notsecret --env FLASK_ENV=development --env LOGGING_LEVEL=INFO -d --network=flexmeasures_network -p 5000:5000 lfenergy/flexmeasures
To upgrade the FlexMeasures database, execute:

.. code-block:: bash
$ docker exec flexmeasures-tutorial-fm bash -c "flexmeasures db upgrade"
.. note:: A tip on Linux/macOS ― You might have the ``docker`` command, but need `sudo` rights to execute it. ``alias docker='sudo docker'`` enables you to still run this tutorial.
Expand Down

0 comments on commit 9df7cb6

Please sign in to comment.