diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..244122d --- /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", "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 + 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-SHELL", "wget -q --spider http://localhost:3002/health || exit 1"] + 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