I'm running a modified version of one of the Osimis recipes for a Docker container running Orthanc. It works fine, except I'd like to have log files for Orthanc available on the host file system.
As it is now, when I start up the containers via the CLI with:
sudo docker-compose up --build (in the foreground), all of the docker-logs are output to the terminal. e.g., which actually is usually fine for development because there is real-time feedback.
pacs-1_1 | W0317 14:55:58.910386 HttpClient.cpp:1132] HTTPS will use the CA certificates from this file: /etc/ssl/certs/ca-certificates.crt
pacs-1_1 | W0317 14:55:58.921744 LuaContext.cpp:93] Lua says: Lua toolbox installed
pacs-1_1 | W0317 14:55:58.923187 LuaContext.cpp:93] Lua says: Lua toolbox installed
pacs-1_1 | W0317 14:55:58.925191 ServerContext.cpp:478] Disk compression is disabled
pacs-1_1 | W0317 14:55:58.925322 ServerIndex.cpp:1659] No limit on the number of stored patients
pacs-1_1 | W0317 14:55:58.927306 ServerIndex.cpp:1676] No limit on the size of the storage area
pacs-1_1 | W0317 14:55:58.938596 ServerContext.cpp:220] Reloading the jobs from the last execution of Orthanc
pacs-1_1 | W0317 14:55:58.939978 JobsEngine.cpp:271] The jobs engine has started with 2 threads
pacs-1_1 | W0317 14:55:58.946106 main.cpp:1194] DICOM server listening with AET SCOTTI_CUSTOM on port: 4242
pacs-1_1 | W0317 14:55:58.946217 HttpServer.cpp:1982] HTTP compression is enabled
pacs-1_1 | W0317 14:55:58.946226 main.cpp:951] ====> Remote access is enabled while user authentication is explicitly disabled, your setup is POSSIBLY INSECURE <====
pacs-1_1 | W0317 14:55:58.946257 main.cpp:1073] Remote LUA script execution is disabled
pacs-1_1 | W0317 14:55:58.975637 HttpServer.cpp:1759] HTTP server listening on port: 8042 (HTTPS encryption is disabled, remote access is allowed)
pacs-1_1 | W0317 14:55:58.977696 main.cpp:827] Orthanc has started
I'd like to write the logs to a file in the Docker Container, and then bind that to a folder / file on the host, like for volumes in the docker-compose.yml.
- ./orthanc-logs:/path/to/dockerlog/orthanc.log
In the Orthanc Book there is some info about doing that:
https://book.orthanc-server.com/faq/log.htmlsudo docker run -a stderr -p 4242:4242 -p 8042:8042 --rm jodogne/orthanc --verbose /etc/orthanc > Orthanc.log 2>&1
But, not sure how to do that from the DockerFile. My Docker File for Orthanc is:
FROM osimis/orthanc
# disable http bundle since we're specifying http parameters in the orthanc.json configuration file
ENV HTTP_BUNDLE_DEFAULTS=false
# disable the auth defaults since we specify them in orthanc.json
ENV AC_BUNDLE_DEFAULTS=false
COPY orthanc.json /etc/orthanc/
RUN pip3 install pydicom
RUN pip3 install pdfkit
RUN pip3 install hl7
RUN pip3 install wkhtmltopdf
RUN pip3 install mysql-connector-python
RUN pip3 install requests
# The 2 below will be replaced by Mirth / Nextgen
# RUN pip3 install aiorun
# RUN pip3 install asyncio
RUN mkdir /etc/orthanc/dicomFiles
COPY dicomFiles/*.* /etc/orthanc/dicomFiles/
RUN mkdir /python
# COPY python/combined.py /python, bound to folder on host where script is
# COPY lua/scriptname.lua /etc/orthanc/scriptname.lua
RUN apt-get update
RUN apt-get --assume-yes install wkhtmltopdf
RUN apt-get --assume-yes install dcmtk