Skip to content

Commit

Permalink
chore: make changes to run all the services
Browse files Browse the repository at this point in the history
  • Loading branch information
apsinghdev committed Oct 25, 2024
1 parent a75949c commit e2f707c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
*~
environment
30 changes: 21 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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"]

4 changes: 2 additions & 2 deletions js/collaboration/collaboration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions planet/js/ServerInterface.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -42,6 +42,7 @@ class ServerInterface {
})
.done(data => {
callback(data);
console.log("success", data);
})
.fail(() => {
callback(this.ConnectionFailureData);
Expand Down

0 comments on commit e2f707c

Please sign in to comment.