nginx
启动命令
docker run -p 80:80 -p 443:443 \
--name mynginx \
-v /home/nginx/www:/var/www/html/website \
-v /home/nginx/ssl/:/var/ssl/ \
-v /home/nginx/dingdangtestssl/:/var/dingdangtestssl/ \
-v /home/nginx/logs/:/var/log/nginx \
-v /home/nginx/conf/conf.d:/etc/nginx/conf.d \
-v /etc/localtime:/etc/localtime \
--restart=on-failure \
-d nginx
conf.d下的 default.conf 文件内容
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
mysql
docker run -p 3306:3306 \
--name mysql \
-v /opt/docker_v/mysql/conf:/etc/mysql/conf.d \
-v /opt/docker_v/mysql/data:/var/lib/mysql \
-v /opt/docker_v/mysql/logs:/logs \
-e MYSQL_ROOT_PASSWORD=mima \
--restart=on-failure \
-d mysql:5.7
rabbitmq
docker run \
--restart=on-failure \
-p 5671:5671 \
-p 5672:5672 \
-p 15672:15672 \
-p 15671:15671 \
-p 25672:25672 \
-v /etc/localtime:/etc/localtime \
-v /home/rabbitmq/data/:/var/rabbitmq/lib \
-e RABBITMQ_DEFAULT_USER=admin \
-e RABBITMQ_DEFAULT_PASS=mima \
-e RABBITMQ_VM_MEMORY_HIGH_WATERMARK=0.05\
--name rabbitmq \
-d rabbitmq
tomcat
docker run --privileged=true \
-v /mnt/sdb1/data/logs/appname:/usr/local/tomcat/logs \
-v /mnt/sdb1/data/webapps/config:/usr/local/tomcat/conf_app \
-v /mnt/sdb1/data/webapps/appname:/usr/local/tomcat/webapps -p 8089:8080 \
-e JAVA_OPTS="-Dconfig.path=/usr/local/tomcat/conf_app/appname -Dsso_config=/usr/local/tomcat/conf_app/sso.properties -Duser.timezone=GMT+08 -Xmx512m" \
--restart always \
--name appname \
-d tomcat:v8
gitlab
docker run \
-p 443:443 \
-p 80:80 \
-p 222:22 \
--restart always \
-v /home/gitlab/config:/etc/gitlab \
-v /home/gitlab/logs:/var/log/gitlab \
-v /home/gitlab/data:/var/opt/gitlab \
--name gitlab \
-d gitlab/gitlab-ce