From f3d580dadca7dcf8074dfff6a405a3c4955cdbb7 Mon Sep 17 00:00:00 2001 From: Aravindan M <83415736+aravindan888@users.noreply.github.com> Date: Mon, 6 Oct 2025 23:25:57 +0530 Subject: [PATCH 1/3] Update and rename sample-compose-fixed.yaml to docker-compose.yaml --- docker-compose.yaml | 51 +++++++++++++++++++++++++++++++++++++++ sample-compose-fixed.yaml | 26 -------------------- 2 files changed, 51 insertions(+), 26 deletions(-) create mode 100644 docker-compose.yaml delete mode 100644 sample-compose-fixed.yaml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..7687b1c --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,51 @@ +version: '3.9' + +services: + python: + build: + context: ./apps/python + container_name: sample-python + ports: + - "3004:3004" + environment: + PORT: 3004 + networks: + - app-net + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:3004/health"] + interval: 10s + timeout: 5s + retries: 5 + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + + go: + build: + context: ./apps/go + container_name: sample-go + ports: + - "3002:3002" + environment: + PORT: 3002 + networks: + - app-net + depends_on: + python: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:3002/health"] + interval: 10s + timeout: 5s + retries: 5 + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + +networks: + app-net: + driver: bridge diff --git a/sample-compose-fixed.yaml b/sample-compose-fixed.yaml deleted file mode 100644 index 8b3f6c9..0000000 --- a/sample-compose-fixed.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Example updated compose generated structure -version: '3.9' -services: - python: - build: - context: ./apps/python - container_name: sample-python - ports: - - "3004:3004" - environment: - PORT: 3004 - networks: - - app-net - go: - build: - context: ./apps/go - container_name: sample-go - ports: - - "3002:3002" - environment: - PORT: 3002 - networks: - - app-net -networks: - app-net: - driver: bridge From f37bd688b2d289ff5d36fabf82ded1a07bf25fc7 Mon Sep 17 00:00:00 2001 From: Mohd Kaif <57701861+kaifcoder@users.noreply.github.com> Date: Tue, 7 Oct 2025 11:00:25 +0530 Subject: [PATCH 2/3] Update docker-compose.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 7687b1c..76397f0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,7 +12,7 @@ services: networks: - app-net healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3004/health"] + test: ["CMD", "python", "-c", "import urllib.request; exit(0) if urllib.request.urlopen('http://localhost:3004/health').getcode() == 200 else exit(1)"] interval: 10s timeout: 5s retries: 5 From 4e425e662f26c461bb52bc53a0e4aba6888c67e5 Mon Sep 17 00:00:00 2001 From: Mohd Kaif <57701861+kaifcoder@users.noreply.github.com> Date: Tue, 7 Oct 2025 11:00:35 +0530 Subject: [PATCH 3/3] Update docker-compose.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 76397f0..244122d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -36,7 +36,7 @@ services: python: condition: service_healthy healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3002/health"] + test: ["CMD-SHELL", "wget -q --spider http://localhost:3002/health || exit 1"] interval: 10s timeout: 5s retries: 5