Docker study notes 06_ deployment appache + tomcat + redis + mongo + python

With the other day deployment nginx + php + mysql + phpmyadmin experience, apache, tomcat, redis, mongo, python simply record what command to start it, much the same.

Start apache

docker run -d -p 80:80 --name xj_apache -v /opt/apache/www:/usr/local/apache2/htdocs -v /opt/apache/conf/httpd.conf:/usr/local/apache2/conf/httpd.conf -v /opt/apache/logs:/usr/local/apache2/logs httpd

httpd.conf on the host I was never apache vessel's path mapped using the docker cp command to get to the, / opt / apache / www which I did not put a file browser to visit http: // IP: 80, see the test result is this.

Start tomcat

docker run --name xj_tomcat -p 8083:8080 -d -v /opt/tomcat/webapps/test:/usr/local/tomcat/webapps/test tomcat

Browser to access http: // IP: 8083, test verification successful deployment

Start redis

docker run -p 6379:6379 --name xj_redis -v /opt/redis/data:/data -d redis redis-server --appendonly yes

docker exec -it xj_redis redis-cli

Start mongo

docker run -p 27017:27017 -d --name xj_mongo -v /opt/mongo/db:/data/db mongo

docker exec -it xj_mongo mongo

Start running python py file container

docker run -v /opt/python/myapp:/usr/src/myapp -w /usr/src/myapp python python helloworld.py

Guess you like

Origin www.cnblogs.com/xjcn/p/11541502.html