diff --git a/docker/README.md b/docker/README.md index c3722d2d6..63f07ece8 100644 --- a/docker/README.md +++ b/docker/README.md @@ -43,7 +43,7 @@ For actinia_core development, run and enter the running container (in a separate ``` docker-compose run --rm --entrypoint /bin/bash -v $HOME/repos/actinia_core/src:/src/actinia_core/src actinia-core -docker-compose -f docker-compose-dev.yml run --rm --entrypoint /bin/bash -v $HOME/repos/actinia/actinia_core/src:/src/actinia_core/src -v $HOME/repos/actinia/actinia_core/scripts:/src/actinia_core/scripts actinia-core +docker-compose -f docker-compose-dev.yml run --rm --entrypoint /bin/bash -v $HOME/repos/actinia/actinia_core/src:/src/actinia_core/src -v $HOME/repos/actinia/actinia_core/scripts:/src/actinia_core/scripts actinia-core``` ``` Inside the container, you can run GRASS GIS with: @@ -71,7 +71,7 @@ python3 setup.py install bash /src/start-dev.sh # python3 -m actinia_core.main -gunicorn -b 0.0.0.0:8088 -w 1 actinia_core.main:flask_app +gunicorn -b 0.0.0.0:8088 -w 1 --access-logfile=- -k gthread actinia_core.main:flask_app ``` If you have problems with cache, run diff --git a/docker/actinia-core-prod/start.sh b/docker/actinia-core-prod/start.sh index d739489b2..2786a473a 100644 --- a/docker/actinia-core-prod/start.sh +++ b/docker/actinia-core-prod/start.sh @@ -14,7 +14,9 @@ grass -text -e -c 'EPSG:4326' /actinia_core/grassdb/latlong_wgs84 # created here, because set in sample config as default location grass -text -e -c 'EPSG:3358' /actinia_core/grassdb/nc_spm_08 -gunicorn -b 0.0.0.0:8088 -w 1 actinia_core.main:flask_app +# optimized gunicorn settings (http://docs.gunicorn.org/en/stable/design.html) # recommended num of workers is (2 x $num_cores) + 1, here minimum is assumed. +# If deployed with 8 replicas, each will run with 3 workers. +gunicorn -b 0.0.0.0:8088 -w 3 --access-logfile=- -k gthread actinia_core.main:flask_app status=$? if [ $status -ne 0 ]; then echo "Failed to start actinia_core/main.py: $status" diff --git a/docker/actinia-core/start.sh b/docker/actinia-core/start.sh index 6e944c55b..f7f2ad0e7 100644 --- a/docker/actinia-core/start.sh +++ b/docker/actinia-core/start.sh @@ -34,7 +34,9 @@ if [ $status -ne 0 ]; then exit $status fi -gunicorn -b 0.0.0.0:8088 -w 1 actinia_core.main:flask_app +# optimized gunicorn settings (http://docs.gunicorn.org/en/stable/design.html) # run only 1 worker for debugging reasons. This is overwritten for production +# deployment. +gunicorn -b 0.0.0.0:8088 -w 1 --access-logfile=- -k gthread actinia_core.main:flask_app status=$? if [ $status -ne 0 ]; then echo "Failed to start actinia_core/main.py: $status"