iotbox starts properly now
This commit is contained in:
parent
41cb41be5f
commit
7b8731c345
|
@ -17,12 +17,18 @@ services:
|
||||||
ipv4_address: 10.5.0.2
|
ipv4_address: 10.5.0.2
|
||||||
iotbox:
|
iotbox:
|
||||||
build: ./iotbox
|
build: ./iotbox
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
command: -- --load=web,hw_proxy,hw_posbox_homepage,hw_posbox_upgrade,hw_scale,hw_scanner,hw_escpos,hw_blackbox_be,hw_screen,hw_drivers,hw_printer_network
|
command: -- --load=web,hw_proxy,hw_posbox_homepage,hw_posbox_upgrade,hw_scale,hw_scanner,hw_escpos,hw_blackbox_be,hw_screen,hw_drivers,hw_printer_network
|
||||||
ports:
|
ports:
|
||||||
- 8070:8069
|
- 8070:8069
|
||||||
- 8072:8072
|
- 8072:8072
|
||||||
volumes:
|
volumes:
|
||||||
- /dev/bus/usb:/dev/bus/usb
|
- /dev/bus/usb:/dev/bus/usb
|
||||||
|
environment:
|
||||||
|
- HOST=db
|
||||||
|
- USER=odoo
|
||||||
|
- PASSWORD=odoo
|
||||||
networks:
|
networks:
|
||||||
localnet:
|
localnet:
|
||||||
ipv4_address: 10.5.0.3
|
ipv4_address: 10.5.0.3
|
||||||
|
|
|
@ -57,22 +57,28 @@ RUN set -x; apt-get update \
|
||||||
&& mkdir /usr/lib/python3/dist-packages/odoo/addons/hw_drivers/drivers
|
&& mkdir /usr/lib/python3/dist-packages/odoo/addons/hw_drivers/drivers
|
||||||
|
|
||||||
RUN pip3 install \
|
RUN pip3 install \
|
||||||
pyusb==1.0.0b1 \
|
|
||||||
evdev \
|
evdev \
|
||||||
gatt \
|
gatt \
|
||||||
v4l2 \
|
phonenumbers \
|
||||||
polib \
|
polib \
|
||||||
pycups
|
pycups \
|
||||||
|
pyusb==1.0.0b1 \
|
||||||
# See https://bugs.launchpad.net/python-v4l2/+bug/1664158
|
v4l2
|
||||||
COPY python-v4l2-1664158-fix.patch /tmp
|
|
||||||
RUN patch -p0 /usr/local/lib/python3.5/dist-packages/v4l2.py < /tmp/python-v4l2-1664158-fix.patch
|
|
||||||
|
|
||||||
#USER odoo
|
|
||||||
|
|
||||||
## Get pos-addons for pos_printer_network
|
## Get pos-addons for pos_printer_network
|
||||||
RUN git clone --depth=1 -b 12.0 https://github.com/it-projects-llc/pos-addons.git \
|
RUN git clone --depth=1 -b 12.0 https://github.com/it-projects-llc/pos-addons.git \
|
||||||
/opt/posbox/addons
|
/opt/posbox/addons
|
||||||
|
|
||||||
|
## Apply some patches
|
||||||
|
COPY patches/*.patch /tmp/
|
||||||
|
# See https://bugs.launchpad.net/python-v4l2/+bug/1664158
|
||||||
|
RUN patch -p0 /usr/local/lib/python3.5/dist-packages/v4l2.py < /tmp/python-v4l2-1664158-fix.patch \
|
||||||
|
# Disable Bluetooth in driver, doesn't work in Docker and isn't needed for the PoS use-case
|
||||||
|
&& patch -p0 /usr/lib/python3/dist-packages/odoo/addons/hw_drivers/controllers/driver.py < /tmp/disable-bluetooth-driver.patch \
|
||||||
|
# Start CUPS - IoTBox connects to it and complains if it isn't running
|
||||||
|
&& patch -p0 /entrypoint.sh < /tmp/start-cups.patch
|
||||||
|
|
||||||
|
#USER odoo
|
||||||
|
|
||||||
COPY odoo.conf /etc/odoo/odoo.conf
|
COPY odoo.conf /etc/odoo/odoo.conf
|
||||||
COPY entrypoint.sh /
|
|
||||||
|
|
6
iotbox/bootstrap.min.js
vendored
6
iotbox/bootstrap.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,44 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# set the postgres database host, port, user and password according to the environment
|
|
||||||
# and pass them as arguments to the odoo process if not present in the config file
|
|
||||||
: ${HOST:=${DB_PORT_5432_TCP_ADDR:='db'}}
|
|
||||||
: ${PORT:=${DB_PORT_5432_TCP_PORT:=5432}}
|
|
||||||
: ${USER:=${DB_ENV_POSTGRES_USER:=${POSTGRES_USER:='odoo'}}}
|
|
||||||
: ${PASSWORD:=${DB_ENV_POSTGRES_PASSWORD:=${POSTGRES_PASSWORD:='odoo'}}}
|
|
||||||
|
|
||||||
DB_ARGS=()
|
|
||||||
function check_config() {
|
|
||||||
param="$1"
|
|
||||||
value="$2"
|
|
||||||
if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then
|
|
||||||
DB_ARGS+=("--${param}")
|
|
||||||
DB_ARGS+=("${value}")
|
|
||||||
fi;
|
|
||||||
}
|
|
||||||
check_config "db_host" "$HOST"
|
|
||||||
check_config "db_port" "$PORT"
|
|
||||||
check_config "db_user" "$USER"
|
|
||||||
check_config "db_password" "$PASSWORD"
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
-- | odoo)
|
|
||||||
shift
|
|
||||||
/etc/init.d/cups start
|
|
||||||
/etc/init.d/dbus start
|
|
||||||
if [[ "$1" == "scaffold" ]] ; then
|
|
||||||
exec odoo "$@"
|
|
||||||
else
|
|
||||||
exec odoo "$@" "${DB_ARGS[@]}"
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
-*)
|
|
||||||
exec odoo "$@" "${DB_ARGS[@]}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
exec "$@"
|
|
||||||
esac
|
|
||||||
|
|
||||||
exit 1
|
|
12
iotbox/patches/disable-bluetooth-driver.patch
Normal file
12
iotbox/patches/disable-bluetooth-driver.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
--- driver.py.orig 2019-06-27 22:11:55.411759929 +0200
|
||||||
|
+++ driver.py 2019-06-27 22:12:02.794867070 +0200
|
||||||
|
@@ -396,6 +396,6 @@
|
||||||
|
m.daemon = True
|
||||||
|
m.start()
|
||||||
|
|
||||||
|
-bm = BtManager()
|
||||||
|
-bm.daemon = True
|
||||||
|
-bm.start()
|
||||||
|
+#bm = BtManager()
|
||||||
|
+#bm.daemon = True
|
||||||
|
+#bm.start()
|
10
iotbox/patches/start-cups.patch
Normal file
10
iotbox/patches/start-cups.patch
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
--- entrypoint.sh.orig 2019-06-27 22:17:01.881714065 +0200
|
||||||
|
+++ entrypoint.sh 2019-06-27 22:16:08.094244835 +0200
|
||||||
|
@@ -26,6 +26,7 @@
|
||||||
|
case "$1" in
|
||||||
|
-- | odoo)
|
||||||
|
shift
|
||||||
|
+ /etc/init.d/cups start
|
||||||
|
if [[ "$1" == "scaffold" ]] ; then
|
||||||
|
exec odoo "$@"
|
||||||
|
else
|
Reference in a new issue