Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
F-X64 committed Nov 25, 2022
1 parent 114c179 commit dd4c120
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ http://127.0.0.1:5000/apidocs/ by default.
The API server will read its configuration on boot from the .env file located in
`src/rhelocator/api/.env`.

### How to build the API container on your local system
1. Build the container from within the rhelocator directory:
```
buildah bud -f ./Containerfile --format docker --tls-verify=true -t rhelocator:latest .
```

2. Run the container, forward the Flask default port 5000 and mount a json file containing test data to
`/opt/rhelocator/opt/rhelocator/data/image-data.json`.
```
podman run -p 5000:5000 -v ./tests/api/testdata/formatted_images.json:/opt/rhelocator/data/image-data.json:Z rhelocator
```
Mind that this is only meant for local testing and should not run like this in production. The Z operator at the end of the
volume mount is necessary for SELinux and applies the same (MCS)[https://en.wikipedia.org/wiki/Multi_categories_security]
labels to the mounted data that the container will run with. For more information see this former (Project Atomic)[https://projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux/] article (now CoreOS).


## Running tests

Use poetry to run pytest:
Expand Down

0 comments on commit dd4c120

Please sign in to comment.