Skip to content

Add support for Docker #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mysql
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,26 @@ type: competition
publish: true
```

# Setup of a Simulation Server Infrastructure
## Run webots.cloud Locally

```bash
docker run --rm -p "8088:80" -v ${PWD}/php:/php -v ${PWD}/httpdocs:/app -v ${PWD}/mysql:/var/lib/mysql mattrayner/lamp:latest-1804
```

The webots.cloud website is now available at:
http://localhost:8088/

and you can access PhpMyAdmin at:
http://localhost:8088/phpmyadmin/

> **Note**: The username is `admin` and the password is randomly generated, shown in the console output (e.g. `You can now connect to this MySQL Server with y6yHUcJaK1fw`)

You will also need to import the database and create a new config file:
- Use [this link](http://localhost:8088/phpmyadmin/index.php?route=/server/databases&server=1) to create a new database called `webots-cloud`.
- Use [this link](http://localhost:8088/phpmyadmin/index.php?route=/database/import&db=webots-cloud) to import the database from the file [`database/webots-cloud.sql`](database/webots-cloud.sql).
- Create a new config out of the [`php/database.php.template`](httpdocs/php/database.php.template) template.


## Setup of a Simulation Server Infrastructure

Follow the instructions [here](https://cyberbotics.com/doc/guide/web-server).
2 changes: 1 addition & 1 deletion httpdocs/js/webots-cloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ document.addEventListener('DOMContentLoaded', function() {
}
const admin = project.email ? project.email.endsWith('@cyberbotics.com') : false;
const typeName = (data.duration === 0) ? 'scene' : 'animation';
const url = data.url.startsWith('https://webots.cloud') ? document.location.origin + data.url.substring(20) : data.url;
const url = data.url.startsWith('https://webots.cloud') ? document.location.origin + data.url.substring(20) : data.url.substring(18);
const thumbnailUrl = url.slice(0, url.lastIndexOf('/')) + '/storage' + url.slice(url.lastIndexOf('/')) + '/thumbnail.jpg';
const defaultThumbnailUrl = document.location.origin + '/images/thumbnail_not_available.jpg';
const versionUrl = `https://github.com/cyberbotics/webots/releases/tag/${data.version}`;
Expand Down