From 75f6e09eff64ceee68243822cea7e8888d7f3b9d Mon Sep 17 00:00:00 2001 From: Julien Mercier-Rojas Date: Thu, 29 Aug 2024 22:23:37 +0200 Subject: [PATCH] Initialize docker version of LG --- .docker/Dockerfile | 6 ++ .docker/LJ.conf.docker | 119 +++++++++++++++++++++++++++++++++++++++ .docker/config.js.docker | 1 + .gitignore | 1 + docker-compose.yml | 39 +++++++++++++ main.py | 2 +- 6 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 .docker/Dockerfile create mode 100644 .docker/LJ.conf.docker create mode 100644 .docker/config.js.docker create mode 100644 docker-compose.yml diff --git a/.docker/Dockerfile b/.docker/Dockerfile new file mode 100644 index 0000000..b8e4519 --- /dev/null +++ b/.docker/Dockerfile @@ -0,0 +1,6 @@ +FROM python +RUN pip install redis numpy scipy pyserial + +RUN mkdir -p /project +WORKDIR /project +CMD python main.py \ No newline at end of file diff --git a/.docker/LJ.conf.docker b/.docker/LJ.conf.docker new file mode 100644 index 0000000..e36e521 --- /dev/null +++ b/.docker/LJ.conf.docker @@ -0,0 +1,119 @@ +[General] +lasernumber = 1 +debug = 0 +rediserverip = redis +wwwip = 10.0.2.3 +nozoscip = 127.0.0.1 +oscserverip = 127.0.0.1 +autostart = artnet +wstype = ws +wsport = 9001 + +[laser0] +color = -1 +type = LOCAL +dac_family = helios +ip = 127.0.0.1 +kpps = 10000 +centerx = 7.0 +centery = 61.0 +zoomx = 312.0 +zoomy = 1039.0 +sizex = 32000.0 +sizey = 32000.0 +finangle = -0.02263757042605427 +intens = 255.0 +red = 100 +green = 100 +blue = 100 +swapx = -1 +swapy = -1 +lsteps = [ (1.0, 8),(0.25, 3), (0.75, 3), (1.0, 10)] +warpdest = [[-1500., 1500.], + [ 1500., 1500.], + [ 1500.,-1500.], + [-1500.,-1500.]] + +[laser1] +color = -1 +type = LOCAL +dac_family = helios +ip = 192.168.2.5 +kpps = 25000 +centerx = 0 +centery = 0 +zoomx = 50.0 +zoomy = 50.0 +sizex = 32000 +sizey = 32000 +finangle = 0.0 +intens = 255 +red = 100 +green = 100 +blue = 100 +swapx = -1 +swapy = -1 +lsteps = [ (1.0, 2),(0.25, 1), (0.75, 1), (1.0, 5)] +warpdest = [[-1500., 1500.], + [ 1500., 1500.], + [ 1500.,-1500.], + [-1500.,-1500.]] + +[laser2] +color = -1 +type = LUKE400 +dac_family = helios +ip = 192.168.2.6 +kpps = 25000 +centerx = 0 +centery = 0 +zoomx = 50.0 +zoomy = 50.0 +sizex = 32000 +sizey = 32000 +finangle = 0.0 +intens = 255 +red = 100 +green = 100 +blue = 100 +swapx = -1 +swapy = -1 +lsteps = [(1.0, 8),(0.25, 3), (0.75, 3), (1.0, 10)] +warpdest = [[-1500., 1500.], + [ 1500., 1500.], + [ 1500.,-1500.], + [-1500.,-1500.]] + +[laser3] +color = -1 +type = LUKE400 +dac_family = helios +ip = 192.168.1.5 +kpps = 25000 +centerx = 0 +centery = 0 +zoomx = 50.0 +zoomy = 50.0 +sizex = 32000 +sizey = 32000 +finangle = 0.0 +intens = 255 +red = 100 +green = 100 +blue = 1000 +swapx = -1 +swapy = -1 +lsteps = [(1.0, 8),(0.25, 3), (0.75, 3), (1.0, 10)] +warpdest = [[-1500., 1500.], + [ 1500., 1500.], + [ 1500.,-1500.], + [-1500.,-1500.]] + +[plugins] +plugins = { + "aurora": {"OSC": 8090, "command": "python3 plugins/aurora/aurora.py", "display": True}, + "artnet": {"OSC": 8009, "command": "python3 libs3/artnet.py", "display": False}, + "square": {"OSC": 8013, "command": "python3 plugins/square.py", "display": True}, + "custom1": {"OSC": 8014, "command": "python3 plugins/custom1.py", "display": True} + } + diff --git a/.docker/config.js.docker b/.docker/config.js.docker new file mode 100644 index 0000000..402a4ac --- /dev/null +++ b/.docker/config.js.docker @@ -0,0 +1 @@ +websocket_uri = "ws://127.0.0.1:9001/" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 06df7ba..52f1c70 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .*swp* *__pycache__ www/config.js +.idea diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..922c637 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,39 @@ +networks: + default: + driver: bridge + ipam: + driver: default + config: + - subnet: 10.0.2.0/24 + +services: + redis: + image: redis + networks: + default: + ipv4_address: 10.0.2.2 + + lj: + build: + dockerfile: Dockerfile + context: .docker/ + ports: + - "9001:9001" + - "9002:9002" + volumes: + - .:/project + - .docker/LJ.conf.docker:/project/LJ.conf + networks: + default: + ipv4_address: 10.0.2.3 + + apache: + image: httpd + ports: + - "8080:80" + volumes: + - ./www:/usr/local/apache2/htdocs/ + - .docker/config.js.docker:/usr/local/apache2/htdocs/config.js:ro + networks: + default: + ipv4_address: 10.0.2.4 diff --git a/main.py b/main.py index f37e951..5f1426a 100755 --- a/main.py +++ b/main.py @@ -158,7 +158,7 @@ oscserverIP = gstt.oscIPin # OSC Server : accept OSC message on port 8002 #oscIPin = "192.168.1.10"s -oscserverIPin = serverIP +oscserverIPin = oscserverIP oscserverPORTin = 8002 # OSC Client : to send OSC message to an IP port 8001 -- 2.20.1