Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# syntax=docker/dockerfile:1

FROM python:3.8-slim-buster
FROM python:3.9-slim-buster

WORKDIR /pymodbus

EXPOSE 8080
EXPOSE 5020

COPY . .

RUN pip3 install -r requirements.txt && pip3 install -e .
RUN pip install -r requirements.txt && pip install -e .
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the container there is no other python version so no need to keep the references to pip3

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep pip3, that way we do not get side effects if python2 is installed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure I'll update. However, the scenario you are talking about it's not something that would happen accidentally.
Requires modify the dockerfile. However, I don't mind to revert the change


CMD [ "pymodbus.server", "--host", "127.0.0.1", "--web-port", "8080", "--no-repl", "run", "--modbus-port", "5020", "--modbus-server", "tcp" ]
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ Or to install a specific release:
You can also use Docker to run a local image with the package installed on the image:

docker pull riptideio/pymodbus

To run this, you will need to expose ports 8080 and 5020, you can the container running:

docker run -it -p 8080:8080 -p 5020:502 riptideio/pymodbus

You can also override the default command running the server with any of the examples:

docker run -it -p 8080:8080 -p 5020:502 riptideio/pymodbus examples/server_sync.py

Otherwise you can pull the trunk source and install from there::

Expand Down