Within a Python script you can access data and other Python modules using Z:\ mapping. For example, data in /myuser/myproject/data can be accessed as z:\myuser\myproject\data. Once you reference the path to the data using Z:\ mapping, the script runs properly:
https://enterprise.arcgis.com/en/server/latest/publish-services/linux/deploying-custom-python-packages.htm
In your prefer native Linux experience when running Python scripts on Linux, starting at 10.5, you can try to use the Python 3 Runtime for ArcGIS Server on Linux:
http://enterprise.arcgis.com/en/server/latest/administer/linux/linux-python.htm