Skip to content

Commit

Permalink
Merge pull request #399 from imincik/ex-python-web-cont-sipl
Browse files Browse the repository at this point in the history
examples(python-web): simplify container configuration
  • Loading branch information
imincik authored Dec 22, 2023
2 parents f6a0eda + 2199a0c commit 238fdb5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
4 changes: 2 additions & 2 deletions examples/python-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```


Expand Down
4 changes: 2 additions & 2 deletions examples/python-web/geonix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down

0 comments on commit 238fdb5

Please sign in to comment.