How to expose port [Docker Actyx App]

Hi guys,

let’s say I have developed an Actyx-App, that needs to be accessible from outside via some port.
Sure I can expose a port using the Dockerfile, but even if I expose the port here the “docker run” command will need to open the port e.g. “docker run -p 9999:9999/tcp”.
The problem though is, that when I package the docker image via “ax apps package” I cannot specify the docker run command, therefore the port[9999/tcp] will not be accessible from outside. :frowning:
How can I specify the “docker run” command for the Actyx-Docker-App, so that the port will be exposed? :slight_smile:

WORKDIR /usr/src/myactyxapp
EXPOSE 9999/tcp

COPY package*.json ./
RUN npm ci --only=production
COPY . .
CMD [ "npm", "start" ]

Hi @LennartBusekrus,

the issue could be that you have to export the port at the ActyxOS container as well. The other way is to start ActyxOS with network_mode=host. But this only works on Linux and MAC.

Hi @alex_AX ,

thank you for your respond. Unfortunately I was already doing that, the problem is that, the Actyx-Node needs to run my docker app with a modified command, which would specifly to open the port.

For example if I would run the docker image, that was build from the given Dockerfile, even tough I put “EXPOSE 9999/tcp” in the file, I would have to run the image with the command “docker run myimage -p 9999:9999/tcp” to open the port.
But when I package the Docker-Image via “ax apps package .” I cannot influence the Docker-Run command that would start my Docker-Image, therefore the port 9999/tcp would not be open.

So how can I tell the Actyx-Node to open the port, hence modify the command that the actyx-docker-app is run by?

Good morning,

check out this example: Github wago-connector
In this example, I open a UDP port on 1202 to receive the network variable list from the PLC.

I do not expose the port in the Dockerfile, I expose it in the docker-compose.yaml file, linked in the ax-manifest

Could you give it a try?

Thank you, @alex_AX I was missing the port-section in the docker-compose.yml file!