Dockerfiles, Docker Compose and Kubernetes configuration for running an Odoo based PoS in containers.
docker-compose upContinue with "Odoo PoS configuration"
The provided YAML files have been developed and tested with k3s on amd64 and arm64.
Installation will happen in the namespace pos.
kubectl apply -f deployment/Continue with "Odoo PoS configuration"
pos and iotboxdocs/)docs/)The default addons from Odoo core are not enough for a smooth PoS experience, therefore a good amount of PoS addons can be used. This distributions adds the following addon sources:
hw_printer_network && pos_printer_network: Support for network receipt printermonitoring_status: Status endpoint for Odoopos_product_category_filter: Only show selected product categories on the PoS viewThe following addons are delivered in this repository:
ip_pos_ticket_order_number: Custom made module to print a big order number both on
the receipt and kitchen orderpos_product_sequence: Commercial module to manually order products (default is
alphabetically). You're not allowed to use this module unless you bought it as
well. See POS Product Sequence
on the Odoo app store. +
+----------------+ |
| Raspberry Pi 4 | WLAN|
| (K3s, Pi-hole) | +-----+
| DHCP, DNS |
| 192.168.233.9 |
+-------+--------+
|
|
+---------------+-----------------+
+---------+ | Router, Switch and Access Point |
|WLAN | (Mikrotik RB2011) |
| | 102.168.233.1 |
| +-----+---------------------+-----+
+ | |
| |
+-----------+ +--------+-------+ +-------+--------+
| Cash desk | | Printer 1 | | Printer 2 |
| tablet | | (Cash desk) | | (Kitchen) |
| | | 192.168.233.3 | | 192.168.233.5 |
+-----------+ +-------+--------+ +----------------+
|
|
+-------+--------+
| Cash drawer |
+----------------+
192.168.233.0/24192.168.233.1: Mikrotik: WLAN and Switch192.168.233.3: Cashdesk receipt printer with cash drawer192.168.233.5: Kitchen printer192.168.233.9: Raspberry Pi (pospi)192.168.233.10-50: DHCP RangeThe Raspberry Pi 4 provides DNS and DHCP to the network with Pi-hole.
Static DNS entries pos and iotbox are added to /etc/hosts which
then are served by the Pi-hole DNS server. The Pi-hole Lighttpd must
be configured to listen on f.e. port 8080 so it doesn't conflict with
K3s ingress. The Raspberry Pi is connected to the PoS network using an
Ethernet connection and to the internet using WLAN. This optionally allows
to use it as an internet gateway by adding some IPtables rules:
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
A good thing is to install Wireguard and use it as remote access to the Raspberry Pi.
When using an Android tablet, a "kiosk" browsing app is the recommended way to provide the PoS webapp to the user. F.e. Fully Single App Kiosk. For iPad just add the webapp to the home screen using Safari, no additional app is needed.
An UPS is also recommended to power the setup so that short power outages don't interrupt the ordering process.
There are two kinds of monitoring prepared: The cluster itself and the PoS application.
Under contrib/healthchecks-cronjob.yaml a simple Kubernetes cronjob is
provided which regularly pings Healthchecks.io.
This helps to see if the whole thing is up and running.
A secret with the ping URL needs to be added before the CronJobs can do it's work:
kubectl -n posmon create secret generic healthchecks-io --from-literal=HCURL=https://hc-ping.com/MYUUID
Application monitoring is done using Prometheus, Alertmanager and Blackbox exporter. No application specific exporters are used, so it's just a base monitoring to answer the question: "Is it up?".
kubectl apply -f https://raw.githubusercontent.com/coreos/prometheus-operator/master/bundle.yamlkubectl apply -f contrib/posmon/kubectl -n posmon create secret generic additional-scrape-configs --from-file=contrib/pos-blackbox-exporter-scrape.yamlkubectl -n posmon create secret generic alertmanager-posmon --from-file=contrib/alertmanager.yamlBackup is done using K8up.
contrib/backupRestore from Restic and then do a database import:
createdb -T template0 restoretest
pg_restore -d restoretest /data/odoo_data.dump
Docker images are automatically built on Docker Hub (for amd64 arch).
docker.io/tobru/odoo-pos:latest-iotbox: IoT Boxdocker.io/tobru/odoo-pos:latest-pos: OdooTL;DR: It's not easy to run things out of the box on Raspberry Pi / ARM.
Images for ARM64 (f.e. Raspberry Pi) are not automatically built as this is not supported by Docker Hub. They are built manually on a Raspberry Pi and uploaded to Docker Hub.
docker.io/tobru/odoo-pos:latest-iotbox-arm64v7: IoT Boxdocker.io/tobru/odoo-pos:latest-pos-arm64v7: OdooAs the upstream Odoo doesn't support
linux/arm/v7 even the base image needs to be built on the Raspberry Pi:
wkhtmltox to install raspbian.stretch_armhf.debdocker build -t local/odoo:12 .A good amount of upstream stuff doesn't work on Raspberry Pi as no multiarch images are provided. F.e. the proposed monitoring stack with Prometheus doesn't work out of the box and K8up doesn't provide arm binaries (yet).
The Postgres client installed in the Odoo images is version 9.6 (it's based
on Debian Stretch and upstream doesn't provide armhf packages).
If you're using a newer Postgres version, the DB management functionality of
Odoo (Backup/Restore) won't work because of version mismatch.
There are some things which could be improved:
monitoring_status and use for K8s probes/monitoring/statusserver_wide_modules (instead of using command line parameters)
base,web,monitoring_statusThis is a hobby project and is not actively maintained. I don't provide any support! If you feel like contributing something, that's of course appreciated. Feel free to open a Pull Request.
Content type
Image
Digest
Size
634.5 MB
Last updated
about 7 years ago
docker pull tobru/odoo-pos:latest-iotbox