forked from mdeweerd/MetersToHA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
171 lines (144 loc) · 5.59 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
version: '3.5'
services:
# . # #
# . # # ##### # # # # ##### # #
# . # # # # # # ## # # # #
# . # # ##### # # # # # # # #
# . # # # # # # # # # # # #
# . # # # # # # # ## # # #
# . ##### ##### #### # # # ####
# Base image using ubuntu
meters-to-ha-ubuntu:
build:
context: .
args: [--rm]
dockerfile: ./Dockerfile
# user: docker
working_dir: /workdir
environment:
DISPLAY: host.docker.internal:0.0
NO_AT_BRIDGE: 1
volumes: [.:/workdir]
meters-to-ha-run-ubuntu:
extends: meters-to-ha-ubuntu
command: ./apps/meters_to_ha/meters_to_ha.py -c ./config.json --run
meters-to-ha-ubuntu-veolia:
extends: meters-to-ha-ubuntu
command: ./apps/meters_to_ha/meters_to_ha.py --veolia -c ./config.json --run --keep-output
# . ######
# . # # ###### ##### # ## # #
# . # # # # # # # # ## #
# . # # ##### ##### # # # # # #
# . # # # # # # ###### # # #
# . # # # # # # # # # ##
# . ###### ###### ##### # # # # #
# Base image using debian
meters-to-ha-debian:
build:
context: .
args: [--rm]
dockerfile: ./DockerfileDebian
# user: docker
working_dir: /workdir
environment:
DISPLAY: host.docker.internal:0.0
NO_AT_BRIDGE: 1
volumes: [.:/workdir]
meters-to-ha-run-debian:
extends: meters-to-ha-debian
command: ./apps/meters_to_ha/meters_to_ha.py -c ./config.json --run
meters-to-ha-debian-veolia:
extends: meters-to-ha-debian
command: ./apps/meters_to_ha/meters_to_ha.py --veolia -c ./config.json --run --keep-output
meters-to-ha-debian-trace-veolia:
extends: meters-to-ha-debian
command: python3 -m trace --ignore-dir=/usr/lib -t ./apps/meters_to_ha/meters_to_ha.py
-c ./config.json --run --debug --keep-output --veolia
# . #
# . # # # ##### # # # ######
# . # # # # # # ## # #
# . # # # # # # # # # #####
# . ####### # ##### # # # # #
# . # # # # # # ## #
# . # # ###### # # # # ######
#
# Base image using alpine
meters-to-ha-alpine:
build:
context: .
args: [--rm]
dockerfile: ./DockerfileAlpine
# user: docker
working_dir: /workdir
environment:
DISPLAY: host.docker.internal:0.0
NO_AT_BRIDGE: 1
volumes:
- .:/workdir
# Run script in normal mode
#
# Run this using `docker compose run --rm meters-to-ha-run` on the CLI
meters-to-ha-run:
extends: meters-to-ha-alpine
command: ./apps/meters_to_ha/meters_to_ha.py -c ./config.json --run
#
# Standard targets, no debug
#
meters-to-ha-veolia:
extends: meters-to-ha-alpine
command: ./apps/meters_to_ha/meters_to_ha.py --veolia -c ./config.json --run --keep-output
meters-to-ha-veolia-file:
extends: meters-to-ha-alpine
command: ./apps/meters_to_ha/meters_to_ha.py --veolia -c ./config.json --run --keep-output --url=file://./veolia_data.csv --server-type=url
meters-to-ha-veolia-posturl:
extends: meters-to-ha-alpine
command: ./apps/meters_to_ha/meters_to_ha.py --veolia -c ./config.json --run --keep-output --url='https://webhook.site/79c1161f-85cf-4d07-9924-1b11cbec2b16' --server-type=url
meters-to-ha-grdf:
extends: meters-to-ha-alpine
command: ./apps/meters_to_ha/meters_to_ha.py --grdf -c ./config.json --run --keep-output
#
# Debug targets (requires XServer)
#
# Run script in debug mode and keep the recovered output (data) in a file
#
# Run this using `docker compose run --rm meters-to-ha-debug-veolia` on the CLI
meters-to-ha-debug-veolia:
extends: meters-to-ha-alpine
command: ./apps/meters_to_ha/meters_to_ha.py -c ./config.json --veolia --run --debug --keep-output
meters-to-ha-debug-grdf:
extends: meters-to-ha-alpine
command: ./apps/meters_to_ha/meters_to_ha.py -c ./config.json --grdf --run --debug --keep-output
meters-to-ha-debug-local:
extends: meters-to-ha-alpine
command: ./apps/meters_to_ha/meters_to_ha.py -c ./config.json --run --debug --keep-output --local-config
#
# Trace targets (requires XServer, outputs executed code lines)
#
#
meters-to-ha-trace-veolia:
extends: meters-to-ha-alpine
command: python3 -m trace --ignore-dir=/usr/lib -t ./apps/meters_to_ha/meters_to_ha.py
-c ./config.json --run --debug --keep-output --veolia
meters-to-ha-trace-grdf:
extends: meters-to-ha-alpine
command: python3 -m trace --ignore-dir=/usr/lib -t ./apps/meters_to_ha/meters_to_ha.py
-c ./config.json --run --debug --keep-output --grdf
#
# Debug target using WSL XServer
# Note: Not very stable - works first time, Windows'XServer seems to fail after that.
#
meters-to-ha-wind:
extends: meters-to-ha-debug-local
environment:
DISPLAY: :0
command: >
sh -c '
i=0 ; while [ -f /tmp/.X$$i-lock ] ; do i=$$((i+1)) ; done ; echo $$i ;
DISPLAY=:$$i ./apps/meters_to_ha/meters_to_ha.py -c ./config.json --run --debug --keep-output --local-config --veolia
'
volumes:
- \\wsl.localhost\Debian\mnt\wslg\.X11-unix:/tmp/.X11-unix
- \\wsl.localhost\Debian\mnt\wslg\PulseServer:/tmp/PulseServer
- \\wsl.localhost\Debian\mnt\wslg\PulseAudioRDPSink:/tmp/PulseAudioRDPSink
- \\wsl.localhost\Debian\mnt\wslg\PulseAudioRDPSource:/tmp/PulseAudioRDPSource