diff --git a/.bandit b/.bandit index a1be520..2f0b94e 100644 --- a/.bandit +++ b/.bandit @@ -1,2 +1,3 @@ [bandit] +# B101: assert_used skips = B101 diff --git a/Dockerfile b/Dockerfile index 73cd8fc..cbb6e0e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,28 @@ # syntax=docker/dockerfile:1 -# build: -# docker buildx build -t sedr -f Dockerfile . +FROM ubuntu:24.04 AS runtime -# run: -# docker run -it --rm sedr --openapi https://edrisobaric.k8s.met.no/api --url https://edrisobaric.k8s.met.no - -FROM ubuntu:24.04 +ARG UID=1001 +ARG GID=1001 # Create user with home dir -RUN useradd --create-home sedr - -# Install python and libeccodes-dev. Create /data. +RUN groupadd --gid $GID sedr && \ + useradd \ + --create-home \ + --shell /bin/false \ + --uid $UID \ + --gid sedr \ + sedr + +# Install python RUN apt-get update && \ - apt-get install -y --no-install-recommends python3-dev python3-pip \ + apt-get install -y --no-install-recommends python3-dev \ python3-venv && \ apt-get clean && rm -rf /var/lib/apt/lists/* -# Set workdir and install app with requirements. +# Set workdir WORKDIR /app + COPY *.py requirements.txt pytest.ini ./ RUN python3 -m venv ./venv && \ ./venv/bin/pip install -r /app/requirements.txt diff --git a/README.md b/README.md index c2b0fc0..291df5b 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Experiment ### Test it out -Run docker image: `docker run -it --rm github.com/metno/sedr --openapi https://edrisobaric.k8s.met.no/api --url https://edrisobaric.k8s.met.no` +Run docker image: `docker run -it --rm docker.io/library/sedr --openapi https://edrisobaric.k8s.met.no/api --url https://edrisobaric.k8s.met.no` ### Results testing existing services diff --git a/pytest.ini b/pytest.ini index 2d77a6a..1401d5f 100644 --- a/pytest.ini +++ b/pytest.ini @@ -3,9 +3,7 @@ filterwarnings = ignore::DeprecationWarning ignore::pytest.PytestAssertRewriteWarning addopts = -rP -; log_cli = true -; log_cli_level = WARNING -log_file = ./logs/pytest.log -log_file_level = WARNING +log_cli = true +log_cli_level = WARNING testpaths = - 07-edr-spesifics.py + sedr.py diff --git a/tox.ini b/tox.ini index 5b66daf..aae058a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] -envlist = py310, black, prospector, mypy, bandit +envlist = black, prospector, bandit -[testenv] +[testenv] ; This is a live test against edrisobaric, and should not be run automatically # See also config file pytest.ini deps = -r{toxinidir}/requirements.txt