From e2f707c4bbc54e8fdec4fc1b3915ace37324e2d6 Mon Sep 17 00:00:00 2001 From: apsinghdev Date: Fri, 25 Oct 2024 11:22:46 +0530 Subject: [PATCH] chore: make changes to run all the services --- .gitignore | 1 + docker-compose.yml | 30 +++++++++++++++++++++--------- js/collaboration/collaboration.js | 4 ++-- planet/js/ServerInterface.js | 5 +++-- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index a33a71fe09..c310bcc896 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ *~ +environment \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index abf285b9f0..c0f391fc56 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,24 +1,36 @@ name: musicblocks services: musicblocks: - build: https://github.com/sugarlabs/musicblocks.git#collaboration + # build: https://github.com/sugarlabs/musicblocks.git#test-collab + build: + context: ./ ports: - "3000:3000" - #command: ["python", "-m", "http.server", "3000", "--bind", "0.0.0.0"] + command: ["python", "-m", "http.server", "3000", "--bind", "0.0.0.0"] env_file: - ./environment - #planet-server: - # build: - # dockerfile: ./planet-server/Dockerfile - #volumes: - # - planet-server/planet.sql: + planet-mysql: + image: mysql:8.0 + environment: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: planet + volumes: + - /Users/ajeetpratapsingh/Developer/os/planet-server/planet.sql + ports: + - "3306:3306" + planet-server: + build: + dockerfile: ../planet-server/Dockerfile + ports: + - "8080:8080" collaboration-server: #build: https://github.com/sugarlabs/collaboration-server.git build: - dockerfile: ./collaboration-server/Dockerfile + dockerfile: ../collaboration-server/Dockerfile volumes: - .:/collaboration-server environment: NODE_ENV: development #command: ["npm", "run", "server"] - command: ["npm", "run", "serve"] + command: ["npm", "run", "server"] + diff --git a/js/collaboration/collaboration.js b/js/collaboration/collaboration.js index d1641fa015..2a32921f77 100644 --- a/js/collaboration/collaboration.js +++ b/js/collaboration/collaboration.js @@ -24,7 +24,7 @@ class Collaboration { this.attempts = 0; this.socket = null; this.blockList = this.activity.blocks.blockList; - this.HOST = process.env.COLLAB_HOST; + this.HOST = "http://127.0.0.1"; this.PORT = "8080"; this.hasCollaborationStarted = false; this.updatedProjectHtml = null; @@ -64,7 +64,7 @@ class Collaboration { // Make calls to the socket server makeConnection = (room_id, name) => { // connect to the local server - const socket = io(this.HOST.concat(";", this.PORT)); + const socket = io(this.HOST.concat(":", this.PORT)); socket.on("connect", () => { this.socket = socket; try { diff --git a/planet/js/ServerInterface.js b/planet/js/ServerInterface.js index dcf8b28a82..9a95c01ecc 100644 --- a/planet/js/ServerInterface.js +++ b/planet/js/ServerInterface.js @@ -25,9 +25,9 @@ class ServerInterface { constructor(Planet) { // this.ServerURL = "https://musicblocks.sugarlabs.org/planet-server/index.php"; - this.ServerURL = "http://localhost:3000/planet-server/index.php"); + this.ServerURL = "http://0.0.0.0:8080/planet-server/index.php"; this.ConnectionFailureData = {"success": false, "error": "ERROR_CONNECTION_FAILURE"}; - this.APIKey = process.env.API_KEY; + this.APIKey = "3f2d3a4c-c7a4-4c3c-892e-ac43784f7381"; } request (data, callback) { @@ -42,6 +42,7 @@ class ServerInterface { }) .done(data => { callback(data); + console.log("success", data); }) .fail(() => { callback(this.ConnectionFailureData);