Writing to a file inside a container

I have a Python script which runs a query and prints the output to a text file. When I Dockerize it the output file is not getting created. The Dockerfile is as follows:
FROM python:3
ADD cert_lamp.py /
ADD certificates.txt /
RUN pip inst…