Saving the plot to the workdir of the docker container:
# Use an official Python runtime as a parent image FROM python:3.5 # Set the working directory to /app WORKDIR /app # Copy the current directory contents into the container at /app COPY . /app # Install any needed packages specified in requirements.txt RUN pip install --trusted-host pypi.python.org -r requirements.txt # Make port 80 available to the world outside this container EXPOSE 80 # Define environment variable ENV NAME World # Run app.py when the container launches CMD ["python", "app.py"]
Try to plot the image:
var img = document.createElement("img"); img.src = "/app/TrainingAccLoss.png"; document.body.appendChild(img);
When I’m trying to plot the image, I got an 404 Error.
GET http://localhost:4000/app/TrainingAccLoss.png 404 (NOT FOUND).
I don’t know if there is a possibility to access a file which is inside the workdir.