Cannot access when run in docker


#1

I try to run it on debian with docker.
I

root@email3:~# MIN_PORT=30000; MAX_PORT=30050; docker run --name licode -p  3000:3000 -p $MIN_PORT-$MAX_PORT:$MIN_PORT-$MAX_PORT/udp -p 3001:3001  -p 8080:8080 -e "MIN_PORT=$MIN_PORT" -e "MAX_PORT=$MAX_PORT" -e "PU                       BLIC_IP=163.172.110.9" lynckia/licode
    No parameters -- starting everything
    Running NVM
    Found '/opt/licode/.nvmrc' with version <6.9.2>
    Now using node v6.9.2 (npm v3.10.9)
    [licode] Starting mongodb
    about to fork child process, waiting until server is ready for connections.
    forked process: 256
    all output going to: /opt/licode/build/mongo.log
    child process started successfully, parent exiting
    [licode] Creating superservice in localhost/nuvedb
    MongoDB shell version: 2.4.9
    connecting to: localhost/nuvedb
    Mongo Logs:
    Thu Jul 27 15:20:21.096 [initandlisten] MongoDB starting : pid=256 port=27017 dbpath=/opt/licode/build/db 64-bit host=1b521ef1b0c3
    Thu Jul 27 15:20:21.097 [initandlisten] db version v2.4.9
    Thu Jul 27 15:20:21.097 [initandlisten] git version: nogitversion
    Thu Jul 27 15:20:21.097 [initandlisten] build info: Linux orlo 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 BOOST_LIB_VERSION=1_54
    Thu Jul 27 15:20:21.097 [initandlisten] allocator: tcmalloc
    Thu Jul 27 15:20:21.097 [initandlisten] options: { dbpath: "/opt/licode/build/db", fork: true, logpath: "/opt/licode/build/mongo.log", nojournal: true }
    Thu Jul 27 15:20:21.103 [FileAllocator] allocating new datafile /opt/licode/build/db/local.ns, filling with zeroes...
    Thu Jul 27 15:20:21.103 [FileAllocator] creating directory /opt/licode/build/db/_tmp
    Thu Jul 27 15:20:21.107 [FileAllocator] done allocating datafile /opt/licode/build/db/local.ns, size: 16MB,  took 0.001 secs
    Thu Jul 27 15:20:21.107 [FileAllocator] allocating new datafile /opt/licode/build/db/local.0, filling with zeroes...
    Thu Jul 27 15:20:21.110 [FileAllocator] done allocating datafile /opt/licode/build/db/local.0, size: 64MB,  took 0.002 secs
    Thu Jul 27 15:20:21.112 [websvr] admin web console waiting for connections on port 28017
    Thu Jul 27 15:20:21.112 [initandlisten] waiting for connections on port 27017
    Thu Jul 27 15:20:26.177 [initandlisten] connection accepted from 127.0.0.1:35951 #1 (1 connection now open)
    Thu Jul 27 15:20:26.179 [FileAllocator] allocating new datafile /opt/licode/build/db/nuvedb.ns, filling with zeroes...
    Thu Jul 27 15:20:26.183 [FileAllocator] done allocating datafile /opt/licode/build/db/nuvedb.ns, size: 16MB,  took 0.003 secs
    Thu Jul 27 15:20:26.183 [FileAllocator] allocating new datafile /opt/licode/build/db/nuvedb.0, filling with zeroes...
    Thu Jul 27 15:20:26.186 [FileAllocator] done allocating datafile /opt/licode/build/db/nuvedb.0, size: 64MB,  took 0.002 secs
    Thu Jul 27 15:20:26.186 [FileAllocator] allocating new datafile /opt/licode/build/db/nuvedb.1, filling with zeroes...
    Thu Jul 27 15:20:26.188 [conn1] build index nuvedb.services { _id: 1 }
    Thu Jul 27 15:20:26.188 [FileAllocator] done allocating datafile /opt/licode/build/db/nuvedb.1, size: 128MB,  took 0.002 secs
    Thu Jul 27 15:20:26.190 [conn1] build index done.  scanned 0 total records. 0.001 secs
    Thu Jul 27 15:20:26.190 [conn1] end connection 127.0.0.1:35951 (0 connections now open)
    Thu Jul 27 15:20:26.226 [initandlisten] connection accepted from 127.0.0.1:35952 #2 (1 connection now open)
    Thu Jul 27 15:20:26.231 [conn2] end connection 127.0.0.1:35952 (0 connections now open)
    Thu Jul 27 15:20:26.268 [initandlisten] connection accepted from 127.0.0.1:35953 #3 (1 connection now open)
    Thu Jul 27 15:20:26.272 [conn3] end connection 127.0.0.1:35953 (0 connections now open)
    [licode] SuperService ID 597a04ba516370d3fdbfac54
    [licode] SuperService KEY 11889
    Starting Rabbitmq
    Warning: PID file not written; -detached was passed.
    Starting Nuve
    Starting erizoController
    Starting erizoAgent
    Starting basicExample
    2017-07-27 15:20:35.029  - INFO: ErizoAgent - message: launched new ErizoJS, erizoId: c1dc4f90-f1e4-4fd6-258e-061f3fcfb947
    (node:429) DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
    (node:428) DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
    2017-07-27 15:20:35.138  - INFO: CloudHandler - New erizocontroller ( 597a04c33c1ec201a00218c4 ) in:  163.172.110.9
    2017-07-27 15:20:35.150  - INFO: ErizoController - message: succesfully added to cloudHandler
    [erizo-c1dc4f90-f1e4-4fd6-258e-061f3fcfb947] (node:441) DeprecationWarning: 'GLOBAL' is deprecated, use 'global'
    [erizo-c1dc4f90-f1e4-4fd6-258e-061f3fcfb947] 2017-07-27 15:20:35.262  - INFO: ErizoJS - message: Started, erizoId: c1dc4f90-f1e4-4fd6-258e-061f3fcfb947
    cp: cannot stat '/opt/licode/erizo_controller/erizoClient/dist/erizo.js': No such file or directory
    Cleaning basic example rooms
    BasicExample started

Then I try to open the url: http://163.172.50.9:3000/ from my browser : no success. Connexion refused.
Any idea ?


#2

yep! basicExample is listening on port 3004 not 3000. You have to add it to the start parameter. Also you need to enable SSL at the config to work without a reverse proxy.

You can take a look at: https://hub.docker.com/r/rofl256/ezlicode/ I made this slightly changed image to run licode without this pain :slight_smile:

PS: I made this a few hours ago while thinking over a prototype for your other thread: Freelancer to create video chat application required But I had not much time today to do more than creating the basic container^^


#3

The docker image is bundled with a simple configuration that let’s you test Licode locally easily. If you want to deploy it elsewhere you will need to customize the configuration file. There are several ways to do this, but it’s pretty easy to change the entrypoint of a container and use a simple script that changes the configuration.

As @Cracker_F says, if you’re running this anywhere but in localhost, you will need to enable ssl, or use a reverse proxy like nginx (instructions here).