From 34b3663da80050e31102b24a1bfca163c525794e Mon Sep 17 00:00:00 2001 From: Chelsea Baird <2886700b@student.gla.ac.uk> Date: Tue, 11 Mar 2025 11:57:05 +0000 Subject: [PATCH] chelsea baird-docker.yml update --- .gitignore | 1 + dicom_server/dicomhawk.py | 2 +- docker-compose.yml | 28 +++++++++++++++++----------- 3 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..2eea525d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/dicom_server/dicomhawk.py b/dicom_server/dicomhawk.py index ec1fd794..2b53af5a 100644 --- a/dicom_server/dicomhawk.py +++ b/dicom_server/dicomhawk.py @@ -334,7 +334,7 @@ def start_dicom_server(): if is_port_in_use(dicom_port): print(f"Port {dicom_port} is in use. Please free up the port and try again.") return - ae.start_server(('172.29.0.3', dicom_port), evt_handlers=handlers) + ae.start_server(('0.0.0.0', dicom_port), evt_handlers=handlers) diff --git a/docker-compose.yml b/docker-compose.yml index 9e794605..690d102c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,12 @@ -version: '3.8' # Use the latest version of Compose - + services: logserver: build: ./flask_logging_server/. volumes: - shared_data:/app networks: - host: - ipv4_address: 172.29.0.2 + custom_network: + ipv4_address: 172.28.0.2 ports: - "5000:5000" depends_on: @@ -15,24 +14,31 @@ services: dicomhawk: environment: - - ENABLE_LOGGING=true - - Docker_ENV=true + - ENABLE_LOGGING= ${ENABLE_LOGGING} + - Docker_ENV= ${Docker_ENV} build: ./dicom_server/. volumes: - shared_data:/app ports: - "11112:11112" networks: - host: - ipv4_address: 172.29.0.3 + custom_network: + ipv4_address: 172.28.0.3 + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:11112/health"] + interval: 30s + retries: 3 + start_period: 10s + timeout: 5s + volumes: shared_data: driver: local networks: - host: + custom_network: ipam: config: - - subnet: 172.29.0.0/16 - gateway: 172.29.0.1 \ No newline at end of file + - subnet: 172.28.0.0/16 + gateway: 172.28.0.1 \ No newline at end of file