From 2199a0ca586b0dc93f9d48a0ae2a4f2b0b4ee58e Mon Sep 17 00:00:00 2001 From: Ivan Mincik Date: Fri, 22 Dec 2023 12:03:09 +0100 Subject: [PATCH] examples(python-web): simplify container configuration --- .github/workflows/test-examples.yml | 4 ++-- examples/python-web/README.md | 4 ++-- examples/python-web/geonix.nix | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-examples.yml b/.github/workflows/test-examples.yml index f7b36567..85be2b1b 100644 --- a/.github/workflows/test-examples.yml +++ b/.github/workflows/test-examples.yml @@ -74,9 +74,9 @@ jobs: # python-web-container - name: Test example (if python-web example - container) run: | - nix develop --impure --accept-flake-config --command geonix container python-app + nix develop --impure --accept-flake-config --command geonix container shell sleep 1 - docker run -d --rm -p 5001:5000 python-app:latest + docker run -d --rm -p 5001:5000 shell:latest curl --retry 10 --retry-all-errors localhost:5001 | grep POLYGON if: ${{ matrix.example == 'python-web' }} diff --git a/examples/python-web/README.md b/examples/python-web/README.md index a2eb3111..31c856fe 100644 --- a/examples/python-web/README.md +++ b/examples/python-web/README.md @@ -68,13 +68,13 @@ psql * Build container image and import it in Docker ``` -nix run github:imincik/geospatial-nix#geonixcli -- container python-app +nix run github:imincik/geospatial-nix#geonixcli -- container shell ``` * Run container ``` -docker run --rm -p 5000:5000 python-app:latest +docker run --rm -p 5000:5000 shell:latest ``` diff --git a/examples/python-web/geonix.nix b/examples/python-web/geonix.nix index 460aa972..fabf8136 100644 --- a/examples/python-web/geonix.nix +++ b/examples/python-web/geonix.nix @@ -57,8 +57,8 @@ in processes.flask-run.exec = "poetry run flask --app src/python_app run --host 0.0.0.0 ${lib.optionalString (!config.container.isBuilding) "--reload"}"; - containers.python-app = { - name = "python-app"; + containers.shell = { + # don't copy `.venv` directory to image (it is not portable) copyToRoot = builtins.filterSource (path: type: baseNameOf path != ".venv") ./.; startupCommand = config.procfileScript; };