From a9221fb5eca34c25058c8089ba9b648ccb4a0920 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Tue, 5 Oct 2021 20:54:36 +0200 Subject: [PATCH 1/8] Fix volumes for podman --- docker/docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index f9f6922..893e831 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -72,8 +72,8 @@ services: networks: - net volumes: - - staticdata:/srv/appdata/bite/static - - ./ingress/nginx.conf:/etc/nginx/nginx.conf + - "staticdata:/srv/appdata/bite/static:U" + - "./ingress/nginx.conf:/etc/nginx/nginx.conf" bite: @@ -101,7 +101,7 @@ services: static-files: image: daniviga/bite volumes: - - staticdata:/srv/appdata/bite/static + - "staticdata:/srv/appdata/bite/static:U" command: ["python3", "manage.py", "collectstatic", "--noinput"] mqtt-to-db: From 19e3ae1d9ccb9a2c5edd0eec311617b6418ce4c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Sat, 9 Oct 2021 23:18:44 +0200 Subject: [PATCH 2/8] Add podman to README --- README.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b290866..df6d1a2 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,24 @@ production. ### Requirements -- `docker-ce` or `moby` +- `moby-engine` or `podman-docker` (recommended) - `docker-compose` The project is compatible with Docker for Windows (using Linux executors), but it is advised to directly use a minimal Linux VM instead (via the preferred hypervisor). +### Podman + +`podman`, with `podman-docker` is the recommended way to run BITE, in rootless mode. + +```bash +systemctl start --user podman.socket +export DOCKER_HOST=unix://run/user/$UID/podman/podman.sock +``` + +### Application stack + The application stack is composed by the following components: - [Django](https://www.djangoproject.com/) with From 4690421437ceeaf34b8d3c03f8788490bba320e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Sat, 9 Oct 2021 23:21:30 +0200 Subject: [PATCH 3/8] Make pull quiet in travis --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ec969d1..2de2450 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,12 +11,12 @@ before_install: _iot-simulator: &iot-simulator stage: simulator install: - - docker-compose -f docker/docker-compose.yml pull + - docker-compose -f docker/docker-compose.yml pull -q - docker-compose -f docker/docker-compose.yml build before_script: - docker-compose -f docker/docker-compose.yml -f docker/edge/docker-compose.edge.yml up -d - sleep 30 # warm-up - - DOCKER_HOST='127.0.0.1:22375' docker-compose -f docker/edge/docker-compose.modules.yml pull + - DOCKER_HOST='127.0.0.1:22375' docker-compose -f docker/edge/docker-compose.modules.yml pull -q - DOCKER_HOST='127.0.0.1:22375' docker-compose -f docker/edge/docker-compose.modules.yml build script: - sleep 5 # warm-up @@ -37,7 +37,7 @@ jobs: if: branch = master - stage: django install: - - docker-compose -f docker/docker-compose.yml pull + - docker-compose -f docker/docker-compose.yml pull -q - docker-compose -f docker/docker-compose.yml build before_script: - docker-compose -f docker/docker-compose.yml up -d From b274378100808fa3e3e6d2efd36e033104cd0f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Wed, 8 Dec 2021 18:48:48 +0100 Subject: [PATCH 4/8] Fix docker-compose to run in unprivileged mode --- docker/docker-compose.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 893e831..182af49 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -39,7 +39,7 @@ services: networks: - net ports: - - "${CUSTOM_DOCKER_IP:-0.0.0.0}:123:123/udp" + - "${CUSTOM_DOCKER_IP:-0.0.0.0}:1230:123/udp" # PORT 123 CAN BE USED WHEN RUNNING AS PRIVILEGED USER timescale: <<: *service_default @@ -68,11 +68,11 @@ services: environment: NGINX_ENTRYPOINT_QUIET_LOGS: 1 ports: - - "${CUSTOM_DOCKER_IP:-0.0.0.0}:80:80" + - "${CUSTOM_DOCKER_IP:-0.0.0.0}:8080:80" # PORT 80 CAN BE USED WHEN RUNNING AS PRIVILEGED USER networks: - net volumes: - - "staticdata:/srv/appdata/bite/static:U" + - "staticdata:/srv/appdata/bite/static:U" # REMOVE ':U' ON MOBY/DOCKER - "./ingress/nginx.conf:/etc/nginx/nginx.conf" @@ -101,7 +101,7 @@ services: static-files: image: daniviga/bite volumes: - - "staticdata:/srv/appdata/bite/static:U" + - "staticdata:/srv/appdata/bite/static:U" # REMOVE ':U' ON MOBY/DOCKER command: ["python3", "manage.py", "collectstatic", "--noinput"] mqtt-to-db: From f120fac87804a1bdeb3c2a06b93eb1d1fd4dfcc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Wed, 8 Dec 2021 19:15:38 +0100 Subject: [PATCH 5/8] Make pytz dep explicit and update alpine --- docker/ntpd/Dockerfile | 2 +- requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/ntpd/Dockerfile b/docker/ntpd/Dockerfile index b79c42d..6b50ff6 100644 --- a/docker/ntpd/Dockerfile +++ b/docker/ntpd/Dockerfile @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -FROM alpine:3.12 +FROM alpine:3.15 RUN apk update && apk add chrony && \ chown -R chrony:chrony /var/lib/chrony diff --git a/requirements.txt b/requirements.txt index 0de5e34..27023fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +pytz Django djangorestframework django-health-check From 47713bf7809817724e1b093ab01bff8c7b2b4bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Wed, 8 Dec 2021 22:25:18 +0100 Subject: [PATCH 6/8] Extend the readme --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index df6d1a2..8017c6b 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,21 @@ but it is advised to directly use a minimal Linux VM instead `podman`, with `podman-docker` is the recommended way to run BITE, in rootless mode. +Requirements are: + +- `podman` +- `podman-docker` +- `catatonit` +- `docker-compose` + +On Fedora 33+: + +```bash +sudo dnf install -y podman podman-docker catatonit docker-compose +``` + +To setup `podman` run: + ```bash systemctl start --user podman.socket export DOCKER_HOST=unix://run/user/$UID/podman/podman.sock From dd8adc3d358fda10bcfbf5915690266a15708578 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Wed, 8 Dec 2021 22:34:14 +0100 Subject: [PATCH 7/8] Bump to PG14 --- docker/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 182af49..a099e28 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -43,7 +43,7 @@ services: timescale: <<: *service_default - image: timescale/timescaledb:latest-pg12 + image: timescale/timescaledb:latest-pg14 environment: POSTGRES_USER: "bite" POSTGRES_PASSWORD: "password" From cc93c5ae7596f1553f78d4e35bcff7f643844396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Thu, 9 Dec 2021 10:54:12 +0100 Subject: [PATCH 8/8] Small fix for podman --- docker/edge/docker-compose.edge.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/edge/docker-compose.edge.yml b/docker/edge/docker-compose.edge.yml index 6c73b8a..0df0b96 100644 --- a/docker/edge/docker-compose.edge.yml +++ b/docker/edge/docker-compose.edge.yml @@ -24,7 +24,7 @@ services: image: docker:dind privileged: true environment: - DOCKER_TLS_CERTDIR: + DOCKER_TLS_CERTDIR: "" networks: - net ports: