This guest post is extracted from an original article by Eric Taïeb Walch.Eric Taïeb Walch.
MYSQL_DATABASE: exo
MYSQL_USER: exo
MYSQL_PASSWORD: changeme
MYSQL_ROOT_PASSWORD: changeme
FROM busybox:latest
MAINTAINER Eric Taïeb Walch
RUN mkdir -p /var/lib/mysql && chmod -R 777 /var/lib/mysql
VOLUME /var/lib/mysql
VOLUME /var/lib/mysql
FROM busybox:latest
MAINTAINER Eric Taïeb Walch
RUN mkdir -p /srv/exo
RUN chmod 777 -R /srv/exo
VOLUME /srv/exo
curl -L https://github.com/docker/compose/releases/download/1.2.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
exodata:
restart: on-failure:5
image: teknologist/exo-data
mysqldata:
restart: on-failure:5
image: teknologist/mysql-docker-data
mysql:
restart: on-failure:5
image: mysql/mysql-server:latest
environment:
MYSQL_DATABASE: exo
MYSQL_USER: exo
MYSQL_PASSWORD: changeme
MYSQL_ROOT_PASSWORD: changeme
volumes_from:
- mysqldata
exoplf:
restart: on-failure:5
ports:
- 8080:8080/tcp
image: teknologist/ubuntu-jdk7-exo-mysql
environment:
MYSQL_DATABASE: exo
MYSQL_USER: exo
MYSQL_PASSWORD: changeme
links:
- mysql
volumes_from:
- exodata
volumes_from
links:
- mysql
MYSQL_DATABASE: exo
MYSQL_USER: exo
MYSQL_PASSWORD: changeme
MYSQL_ROOT_PASSWORD: changeme
eric@morpheus:~/exo-compose$ docker-compose up
Creating exocompose_mysqldata_1...
Creating exocompose_exodata_1...
Creating exocompose_mysql_1...
Creating exocompose_exoplf_1...
Attaching to exocompose_mysql_1, exocompose_exoplf_1
mysql_1 | Running mysql_install_db
mysql_1 | 2015-06-08 12:07:00 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql_1 | 2015-06-08 12:07:00 0 [Note] /usr/sbin/mysqld (mysqld 5.6.25) starting as process 22 ...
exoplf_1 | 2015-06-08 12:07:01,891 | INFO | The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib [o.a.catalina.core.AprLifecycleListener]
exoplf_1 | 2015-06-08 12:07:02,334 | INFO | Initializing ProtocolHandler ["http-nio-0.0.0.0-8080"] [o.apache.coyote.http11.Http11NioProtocol]
exoplf_1 | 2015-06-08 12:07:02,384 | INFO | Using a shared selector for servlet write/read [o.apache.tomcat.util.net.NioSelectorPool]
exoplf_1 | 2015-06-08 12:07:02,386 | INFO | Initializing ProtocolHandler ["ajp-bio-0.0.0.0-8009"] [org.apache.coyote.ajp.AjpProtocol]
exoplf_1 | 2015-06-08 12:07:02,405 | INFO | Initialization processed in 1216 ms [org.apache.catalina.startup.Catalina]
exoplf_1 | 2015-06-08 12:09:11,830 | INFO | Starting ProtocolHandler ["http-nio-0.0.0.0-8080"] [o.apache.coyote.http11.Http11NioProtocol]
exoplf_1 | 2015-06-08 12:09:11,835 | INFO | Starting ProtocolHandler ["ajp-bio-0.0.0.0-8009"] [org.apache.coyote.ajp.AjpProtocol]
exoplf_1 | 2015-06-08 12:09:11,838 | INFO | Server startup in 129433 ms [org.apache.catalina.startup.Catalina]
If you started in foreground, hit [CTRL]-C.
eric@morpheus:~/exo-compose$ docker-compose stop
Stopping exocompose_exoplf_1...
Stopping exocompose_mysql_1...
eric@morpheus:~/exo-compose$ docker-compose start
Starting exocompose_mysqldata_1...
Starting exocompose_exodata_1...
Starting exocompose_mysql_1...
Starting exocompose_exoplf_1...
eric@morpheus:~/exo-compose$ docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------
exocompose_exodata_1 /bin/sh Exit 0
exocompose_exoplf_1 /bin/sh -c ${EXO_APP_DIR}/ ... Up 0.0.0.0:8080->8080/tcp
exocompose_mysql_1 /entrypoint.sh mysqld Up 3306/tcp
exocompose_mysqldata_1 /bin/sh Exit 0
Again, you see the data containers are not in running state and that is normal.
Also note: mysql port 3306 is not exposed outside the container. Docker-compose does all the tunnelling for you.
eric@morpheus:~/exo-compose$ docker logs exocompose_exoplf_1
2015-06-08 12:22:12,758 | INFO | The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib [o.a.catalina.core.AprLifecycleListener]
2015-06-08 12:22:13,129 | INFO | Initializing ProtocolHandler ["http-nio-0.0.0.0-8080"] [o.apache.coyote.http11.Http11NioProtocol]
2015-06-08 12:22:13,177 | INFO | Using a shared selector for servlet write/read [o.apache.tomcat.util.net.NioSelectorPool]
2015-06-08 12:22:13,179 | INFO | Initializing ProtocolHandler ["ajp-bio-0.0.0.0-8009"] [org.apache.coyote.ajp.AjpProtocol]
2015-06-08 12:22:13,198 | INFO | Initialization processed in 1274 ms [org.apache.catalina.startup.Catalina]
2015-06-08 12:22:13,517 | INFO | Starting service Catalina [org.apache.catalina.core.StandardService]
2015-06-08 12:22:13,517 | INFO | Starting Servlet Engine: Apache Tomcat/7.0.55 [org.apache.catalina.core.StandardEngine]
2015-06-08 12:22:13,543 | INFO | Deploying web application archive /opt/exo/platform-community-4.2.0-RC1/webapps/forum-gadgets.war [org.apache.catalina.startup.HostConfig]
2015-06-08 12:22:13,543 | INFO | Deploying web application archive /opt/exo/platform-community-4.2.0-RC1/webapps/wiki.war [org.apache.catalina.startup.HostConfig]
2015-06-08 12:22:13,543 | INFO | Deploying web application archive /opt/exo/platform-community-4.2.0-RC1/webapps/eXoPlatformResources.war [org.apache.catalina.startup.HostConfig]
( Your e-mail address will not be published)
I am a Digital Marketing specialist specialized in SEO at eXo Platform. Passionate about new technologies and Digital Marketing. With 10 years' experience, I support companies in their digital communication strategies and implement the tools necessary for their success. My approach combines the use of different traffic acquisition levers and an optimization of the user experience to convert visitors into customers. After various digital experiences in communication agencies as well as in B2B company, I have a wide range of skills and I am able to manage the digital marketing strategy of small and medium-sized companies.