Kkula
Browse Questions » Industrial Edge: Docker App accessing files Originating From other docker app

About User

Questions Asked: 29.3K

Answers Given: 0

0
  • Open

Industrial Edge: Docker App accessing files Originating From other docker app

Hello Everyone,
I am new to app development on Edge Device using Dockers. I am trying to develop a python program which uses the CSV data logged by the node-red docker on IPC. Files that I need access to will change over time (new data will be added every minute). The CSV file is located under path - 'home/edge/sim-edge-data/sim-edge-platform-node-red/files'.
Is it possible to access this csv file from my python app docker? Attached is the docker compose file used to dockerise the python app.
Any suggestions will be appreciated.

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(1)

Accessing CSV Files from a Python App Docker on Edge Device

Hello!

Yes, it is possible to access the CSV file from your Python app Docker container. However, due to the Docker isolation, you'll need to use a volume mount to share the directory containing the CSV file between the Node-RED container and your Python app container.

Here's how you can modify your docker-compose.yml file:


version: "3.7"
services:
  your_python_app:
    image: your_python_image
    volumes:
      - /home/edge/sim-edge-data/sim-edge-platform-node-red/files:/app/data
    # ... other configurations ...

Explanation:

  • /home/edge/sim-edge-data/sim-edge-platform-node-red/files: This is the path on the host (Edge Device) where the Node-RED CSV files are stored.
  • /app/data: This is the path inside your Python app container where the CSV files will be accessible. You can adjust this path to suit your Python application's needs.

In your Python code, you would then access the files using the path /app/data/*.csv.

For detailed information on volume mounts and Docker Compose, refer to the official Docker Compose documentation and Docker Volumes documentation.

If you encounter any further issues, please provide the complete docker-compose.yml file and details about how you are trying to access the CSV file in your Python code.

0
Add a comment