Skip to content

Commit

Permalink
New dockerfile and start script (#871)
Browse files Browse the repository at this point in the history
  • Loading branch information
lodoyun authored May 3, 2017
1 parent ee6f252 commit 76f53df
Show file tree
Hide file tree
Showing 11 changed files with 360 additions and 91 deletions.
33 changes: 33 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.DS_Store
.project
.cproject
licode_config.js
rtp_media_config.js
build/
node_modules/
erizo/build
erizoAPI/build
erizoAPI/.lock-wscript
erizo_controller/erizoClient/dist/erizofc.js
erizo_controller/erizoClient/build/erizofc.js
erizo_controller/erizoClient/dist/erizo.js
erizo_controller/erizoController/node_modules/
erizo_controller/test/public/erizo.js
erizo_controller/erizoAgent/out.log
erizo_controller/erizoAgent/erizo-*.log
extras/basic_example/node_modules
extras/basic_example/public/assets/
extras/basic_example/public/erizo.js
extras/basic_example/nuve.js
extras/vagrant/.vagrant
extras/vagrant/licode/
nuve/.DS_Store
nuve/nuveClient/build
nuve/nuveClient/dist
nuve/nuveClient/dist
nuve/cloudHandler/node_modules/
nuve/nuveAPI/node_modules/
libdeps/
scripts/libdeps/
spine/erizofc.js
site
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ubuntu:14.04

MAINTAINER Lynckia

WORKDIR /opt

# Download latest version of the code and install dependencies
RUN apt-get update && apt-get install -y git wget curl

COPY . /opt/licode

# Clone and install licode
WORKDIR /opt/licode/scripts

RUN ./installUbuntuDeps.sh --cleanup && \
./installErizo.sh && \
./../nuve/installNuve.sh && \
./installBasicExample.sh

WORKDIR /opt

ENTRYPOINT ["./licode/extras/docker/initDockerLicode.sh"]
2 changes: 1 addition & 1 deletion doc/custom_theme/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h1>{{ page_title }}</h1>
{% else %}
<h1>Documentation</h1>
{% endif %}
<p>Licode APIs documentation</p>
<p>Licode documentation</p>
</div>
<div class="col-md-3">{% include "toc.html" %}</div>
<div class="col-md-9" role="main">{% include "content.html" %}</div>
Expand Down
11 changes: 3 additions & 8 deletions doc/custom_theme/nav-sub.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
</li>
{% else %}
<li class="dropdown-submenu">
<a tabindex="-1" href="">{{ nav_item.title }}</a>
<ul class="dropdown-menu">
{% for nav_item in nav_item.children %}
{% include "nav-sub.html" %}
{% endfor %}
</ul>
</li>
{% for nav_item in nav_item.children %}
{% include "nav-sub.html" %}
{% endfor %}
{% endif %}
21 changes: 11 additions & 10 deletions doc/custom_theme/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,15 @@
<li>
<a href="http://lynckia.com/licode/install.html">Installation</a>
</li>
<li class="dropdown active">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation<b class="caret"></b></a>
<ul class="dropdown-menu">
{%- for nav_item in nav %}
{% include "nav-sub.html" %}
{%- endfor %}
</ul>
{%- for nav_item in nav %}
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ nav_item.title }}<b class="caret"></b></a>
<ul class="dropdown-menu">
{% include "nav-sub.html" %}
</ul>
</li>
{%- endfor %}

<li>
<a href="https://chotis2.dit.upm.es/">Try it!</a>
</li>
Expand All @@ -53,9 +54,9 @@
{%- endblock %}

<ul class="nav navbar-nav navbar-right">


</ul>
</div>
</div>
</div>
</div>
33 changes: 21 additions & 12 deletions doc/custom_theme/toc.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<div class="bs-sidebar hidden-print affix-top well" role="complementary">
{%- macro draw_toc_for_nav(nav_item_to_draw) %}

{%- for nav_chil in nav_item_to_draw.children %}
<li class="main"><a href="{{ nav_chil.url }}">{{ nav_chil.title }}</a></li>
{%- if page_title == nav_chil.title%}
{%- for toc_item in toc %}
<li class="{% if toc_item.active %}active{% endif %}"><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
{%- endfor %}
{%- endif %}
{%- endfor %}

{%- endmacro %}
<ul class="nav bs-sidenav">
{%- block search_button %}
<li class="search_nav">
Expand All @@ -8,18 +19,16 @@
</a>
</li>
{%- endblock %}

{%- for nav_item in nav %}
<li class="main"><a href="{{ nav_item.url }}">{{ nav_item.title }}</a></li>
{%- if page_title == nav_item.title%}
{%- for toc_item in toc %}
<li class="{% if toc_item.active %}active{% endif %}"><a href="{{ toc_item.url }}">{{ toc_item.title }}</a></li>
{%- endfor %}
{%- endif %}
{%- endfor %}
{%- for nav_item in nav %}
{%- for nav_child in nav_item.children %}
{%- if nav_child.title == page_title %}
{{ draw_toc_for_nav(nav_item)}}
{%- endif %}
{%- endfor %}
{%- endfor %}
</ul>




</div>


</div>
63 changes: 34 additions & 29 deletions extras/docker/README.md → doc/docker.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,63 @@
# How to use this Dockerfile
# Licode Docker Image

To run a Licode Docker container you have two options:
To run a Licode docker container you have two options:

- You can build your own image using the Dockerfile we provide and then run the container from it or
- you can run the container directly from the image we provide in Docker Hub.

Both options require that you have [docker](https://docs.docker.com/installation/) installed on your machine.

## Build your own image and run the container from it
# Run the container from the latest release in Docker Hub

You have to download the [Licode's code](https://github.com/ging/licode) from GitHub and navigate to `docker` directory. There, to compile your own image just run:

sudo docker build -t licode-image .
The easiest way to run licode is to use the [image we provide](https://hub.docker.com/r/lynckia/licode/) in Docker Hub. In this case you have only to execute the run command. But now the image name is lynckia/licode:*version* where `version` is the release you want to use:

sudo docker run -d --name licode -p 3001:3001 -p 8080:8080 -p 3000:3000 -p 30000-31000:30000-31000/udp -e "PUBLIC_IP=XXX.XXX.XXX.XXX" lynckia/licode

> **Note**
> If you do not want to have to use `sudo` in this or in the next section follow [these instructions](https://docs.docker.com/installation/ubuntulinux/#create-a-docker-group).
This builds a new Docker image following the steps in `Dockerfile` and saves it in your local Docker repository with the name `licode-image`. You can check the available images in your local repository using:

sudo docker images

> If you do not specify a version you are pulling from `latest` by default.
> **Note**
> If you want to know more about images and the building process you can find it in [Docker's documentation](https://docs.docker.com/userguide/dockerimages/).
Now you can run a new container from the image you have just created with:
> If you do not want to have to use `sudo` in this or in the next section follow [these instructions](https://docs.docker.com/installation/ubuntulinux/#create-a-docker-group).
sudo docker run -d --name licode -p 3001:3001 -p 8080:8080 -p 3000:3000 -p 30000-31000:30000-31000/udp -e "PUBLIC_IP=XXX.XXX.XXX.XXX" licode-image

Where the different params mean:
Where the different parameters mean:

* -d indicates that the container runs as a daemon
* --name is the name of the new container (you can use the name you want)
* -p stablishes a relation between local ports and a container's ports.
* PUBLIC_IP tells Licode the IP that is used to access the server from outside
* `-d` indicates that the container runs as a daemon
* `--name` is the name of the new container (you can use the name you want)
* `-p` stablishes a relation between local ports and a container's ports.
* `PUBLIC_IP` tells Licode the IP that is used to access the server from outside
* the last param is the name of the image

Once the container is running you can view the console logs using:

Once the container is running you can view the console logs using:
```
sudo docker logs -f licode

```

To stop the container:

```
sudo docker stop licode
```

Additionally, if you want to run a single Licode component inside the container you can select them by appending `--mongodb`, `--rabbitmq`, `--nuve`, `--erizoController`, `--erizoAgent` or `--basicExample` to the `docker run` command above.

# Build your own image and run the container from it

## Run the container from the last release in Docker Hub
You have to git clone [Licode's code](https://github.com/ging/licode) from GitHub and navigate to `docker` directory. There, to compile your own image just run:

You can also run the container from the [image we provide](https://hub.docker.com/r/lynckia/licode/) in Docker Hub. In this case you have only to execute the run command. But now the image name is lynckia/licode:*version* where `version` is the release you want to use:
```
sudo docker build -t licode-image .
```

sudo docker run -d --name licode -p 3001:3001 -p 8080:8080 -p 3000:3000 -p 30000-31000:30000-31000/udp -e "PUBLIC_IP=XXX.XXX.XXX.XXX" lynckia/licode
This builds a new Docker image following the steps in `Dockerfile` and saves it in your local Docker repository with the name `licode-image`. You can check the available images in your local repository using:

```
sudo docker images
```

> **Note**
> If you do not specify a version you are pulling from `latest` by default.
> If you want to know more about images and the building process you can find it in [Docker documentation](https://docs.docker.com/userguide/dockerimages/).
Now you can run a new container from the image you have just created with:
```
sudo docker run -d --name licode -p 3001:3001 -p 8080:8080 -p 3000:3000 -p 30000-31000:30000-31000/udp -e "PUBLIC_IP=XXX.XXX.XXX.XXX" licode-image
```
63 changes: 63 additions & 0 deletions doc/from_source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Overview
This guide will guide you through the basics of getting a Licode instance with a basic videoconferencing application up and running.

# Prerequisites
We **only** officially support **Ubuntu 14.04** for production environments.

We do maintain compatibility with **Mac OS X** for **development and testing purposes**.


|Ubuntu 14.04 | Mac OS X > 10.11 |
|-------------|------------------|
|git|Xcode Command Line Tools|
| |git|


# Clone Licode
Let's start by cloning the Licode repository
```
git clone https://github.com/lynckia/licode.git
cd licode
```
The repository contains scripts for the rest of the steps of this guide.
# Install dependencies
This step installs the dependencies of all the Licode components. This is the only step that depends on your OS
#### Ubuntu
```
./scripts/installUbuntuDeps.sh
```
#### Mac OS X
```
./scripts/installMacDeps.sh
```

# Install Licode
Here we will install all the Licode components in your computer.
```
./scripts/installNuve.sh
./scripts/installErizo.sh
```
# Install basicExample
The basicExample is a really simple node-based web application that relies on Licode to provide a videoconferencing room.
```
./scripts/installBasicExample.sh
```

# Start Licode!
At this points, you have successfully installed all the Licode components in your computer and also a simple application that will let you try it.
Let's use the convenience script to start all Licode components:
```
./scripts/initLicode.sh
```
After that, we just have to start our node application, we also have a script for that:
```
./scripts/initBasicExample.sh
```
** Now you can connect to _http://localhost:3001_ with Chrome or Firefox and test your basic videoconference example! **

# What's next?

Well you now have a taste of what Licode can do. You can start by modifying basicExample. You can find the code in `licode/extras/basic_example`:
* `basicServer.js` is the node.js server that manages the communication between the clients and Nuve. Here you can add your own methods using the server side API (NuveAPI)

Head to [Licode Architecture](index.md) for more information about different Licode components, or start developing your custom service getting into the client or server APIs.
23 changes: 0 additions & 23 deletions extras/docker/Dockerfile

This file was deleted.

Loading

0 comments on commit 76f53df

Please sign in to comment.