diff --git a/compose.yaml b/compose.yaml index 092dbb7..823de30 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,4 +1,3 @@ - services: api-server: build: @@ -7,17 +6,16 @@ services: container_name: DwinzoApi_V0_end environment: NODE_ENV: development - # Connect to shared MongoDB container from main backend - MONGODB_URI: mongodb://mongo-Dwinzocontainer:27017/dwinzo_demo_db + # Connect to MongoDB on host port 27021 (where main backend MongoDB is exposed) + MONGODB_URI: mongodb://host.docker.internal:27021/dwinzo_demo_db ports: - "5001:5000" # Different port to avoid conflict with main backend expose: - 5000 networks: - - DwinzoMajor - # Remove depends_on mongo since we're using external container - external_links: - - mongo-Dwinzocontainer + - DwinzoDemo + extra_hosts: + - "host.docker.internal:host-gateway" socket-server: build: @@ -26,22 +24,20 @@ services: container_name: DwinzoSocket_V0_end environment: NODE_ENV: development - # Connect to shared MongoDB container from main backend - MONGODB_URI: mongodb://mongo-Dwinzocontainer:27017/dwinzo_demo_db + # Connect to MongoDB on host port 27021 (where main backend MongoDB is exposed) + MONGODB_URI: mongodb://host.docker.internal:27021/dwinzo_demo_db ports: - "8001:8000" # Different port to avoid conflict with main backend expose: - 8000 networks: - - DwinzoMajor - # Remove depends_on mongo since we're using external container - external_links: - - mongo-Dwinzocontainer + - DwinzoDemo + extra_hosts: + - "host.docker.internal:host-gateway" -# Remove mongo service completely - we'll use the one from main backend +# No MongoDB service - we'll connect to the main backend's MongoDB via host networking -# Use external network created by main backend +# Create our own network for demo backend networks: - DwinzoMajor: - external: true - name: dwinzobackend_DwinzoMajor # This should match the network name created by main backend \ No newline at end of file + DwinzoDemo: + driver: bridge \ No newline at end of file