diff --git a/.dockerignore b/.dockerignore index f2f3a83c..c6cdb049 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,11 @@ # Ignore git, data and cache files .git +.github .cache +.pytest_cache + __pycache__ /db +/tests # Also ignore templates /templates diff --git a/Makefile b/Makefile index 1adb23d0..b17fbece 100644 --- a/Makefile +++ b/Makefile @@ -28,17 +28,17 @@ codecov: # Build containers docker-container: - docker build . -t ${CONT_TAG} + docker build . -t ${CONT_TAG} -f containers/Dockerfile podman-container: - podman build . -t ${CONT_TAG} + podman build . -t ${CONT_TAG} -f containers/Dockerfile podman-container-devel: - podman build -f Dockerfile_dev -t pcw-devel + podman build . -f containers/Dockerfile_dev -t pcw-devel podman-container-k8s: - podman build -f Dockerfile_k8s -t pcw-k8s-cleaner + podman build . -f containers/Dockerfile_k8s -t pcw-k8s-cleaner podman-container-k8s-devel: - podman build -f Dockerfile_k8s_dev -t pcw-k8s-cleaner-devel + podman build . -f containers/Dockerfile_k8s_dev -t pcw-k8s-cleaner-devel # Container linting .PHONY: container-lint -container-lint: Dockerfile* - hadolint Dockerfile* +container-lint: containers/Dockerfile* + hadolint containers/Dockerfile* diff --git a/Dockerfile b/containers/Dockerfile similarity index 94% rename from Dockerfile rename to containers/Dockerfile index e7dda81f..ef68da85 100644 --- a/Dockerfile +++ b/containers/Dockerfile @@ -1,10 +1,5 @@ FROM registry.suse.com/bci/python:3.11 -ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 UWSGI_WSGI_FILE=/pcw/webui/wsgi.py UWSGI_MASTER=1 -ENV UWSGI_HTTP_AUTO_CHUNKED=1 UWSGI_HTTP_KEEPALIVE=1 UWSGI_LAZY_APPS=1 UWSGI_WSGI_ENV_BEHAVIOR=holy - -## System preparation steps ################################################# ## - # We do the whole installation and configuration in one layer: COPY requirements.txt /pcw/ # * Install system requirements @@ -32,6 +27,8 @@ EXPOSE 8000/tcp # Required to use system certs in python-requests ENV REQUESTS_CA_BUNDLE=/etc/ssl/ca-bundle.pem +ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 UWSGI_WSGI_FILE=/pcw/webui/wsgi.py UWSGI_MASTER=1 +ENV UWSGI_HTTP_AUTO_CHUNKED=1 UWSGI_HTTP_KEEPALIVE=1 UWSGI_LAZY_APPS=1 UWSGI_WSGI_ENV_BEHAVIOR=holy # Once we are certain that this runs nicely, replace this with ENTRYPOINT. ENTRYPOINT ["/pcw/container-startup", "run"] diff --git a/Dockerfile_dev b/containers/Dockerfile_dev similarity index 100% rename from Dockerfile_dev rename to containers/Dockerfile_dev diff --git a/Dockerfile_k8s b/containers/Dockerfile_k8s similarity index 100% rename from Dockerfile_k8s rename to containers/Dockerfile_k8s diff --git a/Dockerfile_k8s_dev b/containers/Dockerfile_k8s_dev similarity index 100% rename from Dockerfile_k8s_dev rename to containers/Dockerfile_k8s_dev diff --git a/container-startup b/containers/container-startup similarity index 100% rename from container-startup rename to containers/container-startup