diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..356e0e3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ + +# For more information, please refer to https://aka.ms/vscode-docker-python +FROM python:3.9-slim as base + +FROM base as builder +RUN apt-get update \ + && apt-get install gcc=4:10.* git=1:2.* -y \ + && apt-get clean +COPY requirements.txt /app/requirements.txt +WORKDIR /app +ENV PATH=/root/.local/bin:$PATH +RUN pip install --user -r requirements.txt +COPY . /app + +FROM base as app +COPY . /app +COPY --from=builder /root/.local /root/.local + +# # Keeps Python from generating .pyc files in the container +# ENV PYTHONDONTWRITEBYTECODE 1 + +# Turns off buffering for easier container logging +ENV PYTHONUNBUFFERED 1 + +# Access local binaries +ENV PATH=/root/.local/bin:$PATH + +WORKDIR /app + +# During debugging, this entry point will be overridden. For more information, refer to https://aka.ms/vscode-docker-python-debug +CMD ["python", "app.py"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b30763b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3.4' + +services: + dsmr2mqtt: + image: dsmr2mqtt + build: + context: . + dockerfile: Dockerfile + restart: always + network_mode: host + env_file: + - '.env' \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 4c4a89b..b1b6181 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,134 +1,6 @@ -appdirs==1.4.3 -asn1crypto==0.24.0 -astroid==2.1.0 -asttokens==1.1.13 -automationhat==0.2.0 -beautifulsoup4==4.7.1 -blinker==1.4 -blinkt==0.1.2 -buttonshim==0.0.2 -Cap1xxx==0.1.3 -certifi==2018.8.24 -chardet==3.0.4 -Click==7.0 -colorama==0.3.7 -colorzero==1.1 -cookies==2.2.1 -cryptography==2.6.1 -cycler==0.10.0 -decorator==4.3.0 -docutils==0.14 -drumhat==0.1.0 -dsmr-parser==0.21 -entrypoints==0.3 -envirophat==1.0.0 -ExplorerHAT==0.4.2 -Flask==1.0.2 -fourletterphat==0.1.0 -gpiozero==1.5.1 -guizero==0.6.0 -Homie4==0.3.5 -html5lib==1.0.1 -idna==2.6 -ipykernel==4.9.0 -ipython==5.8.0 -ipython-genutils==0.2.0 -isort==4.3.4 -itsdangerous==0.24 -jedi==0.13.2 -Jinja2==2.10 -jupyter-client==5.2.3 -jupyter-core==4.4.0 -keyring==17.1.1 -keyrings.alt==3.1.1 -kiwisolver==1.0.1 -lazy-object-proxy==1.3.1 -logilab-common==1.4.2 -lxml==4.3.2 -MarkupSafe==1.1.0 -matplotlib==3.0.2 -mccabe==0.6.1 -microdotphat==0.2.1 -mote==0.0.4 -motephat==0.0.2 -mypy==0.670 -mypy-extensions==0.4.1 -netifaces==0.10.9 -nudatus==0.0.4 -numpy==1.16.2 -oauthlib==2.1.0 -olefile==0.46 -paho-mqtt==1.5.0 -pantilthat==0.0.7 -parso==0.3.1 -pexpect==4.6.0 -pgzero==1.2 -phatbeat==0.1.1 -pianohat==0.1.0 -picamera==1.13 -pickleshare==0.7.5 -picraft==1.0 -piglow==1.2.5 -pigpio==1.44 -Pillow==5.4.1 -prompt-toolkit==1.0.15 -psutil==5.5.1 -pycairo==1.16.2 -pycodestyle==2.4.0 -pycrypto==2.6.1 -pydantic==1.5.1 -pyflakes==2.0.0 -pygame==1.9.4.post1 -Pygments==2.3.1 -PyGObject==3.30.4 -pyinotify==0.9.6 -PyJWT==1.7.0 -pylint==2.2.2 -pyOpenSSL==19.0.0 -pyparsing==2.2.0 -pyserial==3.4 -pyserial-asyncio==0.4 -python-apt==1.8.4.1 -python-dateutil==2.7.3 -python-dotenv==0.13.0 -pytz==2020.1 -pyxdg==0.25 -pyzmq==17.1.2 -qtconsole==4.3.1 -rainbowhat==0.1.0 -requests==2.21.0 -requests-oauthlib==1.0.0 -responses==0.9.0 -roman==2.0.0 -RPi.GPIO==0.7.0 -RTIMULib==7.2.1 -scrollphat==0.0.7 -scrollphathd==1.2.1 -SecretStorage==2.3.1 -semver==2.0.1 -Send2Trash==1.5.0 -sense-emu==1.1 -sense-hat==2.2.0 -simplegeneric==0.8.1 -simplejson==3.16.0 -six==1.12.0 -skywriter==0.0.7 -sn3218==1.2.7 -soupsieve==1.8 -spidev==3.4 -ssh-import-id==5.7 -tailer==0.4.1 -thonny==3.2.6 -tornado==5.1.1 -touchphat==0.0.1 -traitlets==4.3.2 -twython==3.7.0 -typed-ast==1.3.1 -uflash==1.2.4 -unicornhathd==0.0.4 -urllib3==1.24.1 -virtualenv==15.1.0 -wcwidth==0.1.7 -webencodings==0.5.1 -Werkzeug==0.14.1 -wrapt==1.10.11 +dsmr-parser +Homie4 +pydantic +pyserial +pyserial-asyncio +python-dotenv