Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom requirements to docker compose #528

Merged
merged 7 commits into from Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions docker-compose.yml
Expand Up @@ -53,10 +53,13 @@ services:
# a place for config and plugin code - the mount point is for running the FlexMeasures CLI, the 2nd for gunicorn
- ./flexmeasures-instance/:/usr/var/flexmeasures-instance/:ro
- ./flexmeasures-instance/:/app/instance/:ro
command: >
bash -c "flexmeasures db upgrade
&& flexmeasures add toy-account --name 'Docker Toy Account'
&& gunicorn --bind 0.0.0.0:5000 --worker-tmp-dir /dev/shm --workers 2 --threads 4 wsgi:application"
entrypoint: ["/bin/sh", "-c"]
command:
- |
pip install -r instance/requirements.txt
Flix6x marked this conversation as resolved.
Show resolved Hide resolved
flexmeasures db upgrade
flexmeasures add toy-account --name 'Docker Toy Account'
gunicorn --bind 0.0.0.0:5000 --worker-tmp-dir /dev/shm --workers 2 --threads 4 wsgi:application
worker:
build:
context: .
Expand Down
1 change: 1 addition & 0 deletions documentation/changelog.rst
Expand Up @@ -24,6 +24,7 @@ Infrastructure / Support
----------------------

* Reduce size of Docker image (from 2GB to 1.4GB) [see `PR #512 <http://www.github.com/FlexMeasures/flexmeasures/pull/512>`_]
* Allow extra requirements to be freshly installed when running ``docker-compose up`` [see `PR #528 <http://www.github.com/FlexMeasures/flexmeasures/pull/528>`_]
* Remove bokeh dependency and obsolete UI views [see `PR #476 <http://www.github.com/FlexMeasures/flexmeasures/pull/476>`_]
* Fix ``flexmeasures db-ops dump`` and ``flexmeasures db-ops restore`` incorrectly reporting a success when `pg_dump` and `pg_restore` are not installed [see `PR #526 <http://www.github.com/FlexMeasures/flexmeasures/pull/526>`_]
* Plugins can save BeliefsSeries, too, instead of just BeliefsDataFrames [see `PR #523 <http://www.github.com/FlexMeasures/flexmeasures/pull/523>`_]
Expand Down
2 changes: 2 additions & 0 deletions documentation/dev/docker-compose.rst
Expand Up @@ -65,6 +65,8 @@ Configuration

You can pass in your own configuration (e.g. for MapBox access token, or db URI, see below) like we described in :ref:`docker_configuration` ― put a file ``flexmeasures.cfg`` into a local folder called ``flexmeasures-instance`` (the volume should be already mapped).

In case your configuration loads FlexMeasures plugins that have additional dependencies, you can add a requirements.txt file to the same local folder. The dependencies listed in that file will be freshly installed each time you run ``docker-compose up``.


Data
-------
Expand Down