Pig平台docker-compose部署
容器化部署MariaDB
curl -O http://172.19.25.11/Pig.tar.gz
tar -xf Pig.tar.gz
cd Pig
1 2 3 4 5 6 7 8 9 10 11 12 13
| [root@node-szzjs002-1958801-g3yaw Pig]# cat Dockerfile-mariadb FROM centos:centos7.9.2009 MAINTAINER Chinaskill RUN rm -rf /etc/yum.repos.d/* ADD local.repo /etc/yum.repos.d/ copy yum /root/yum ENV LC_ALL en_US.UTF-8 RUN yum install -y mariadb-server ADD mysql /opt/ copy mysql_init.sh /opt/ RUN bash /opt/mysql_init.sh EXPOSE 3306 CMD ["mysqld_safe","--user=root"]
|
1 2 3 4 5 6 7 8
| [root@node-szzjs002-1958801-g3yaw Pig]# cat mysql_init.sh #!/bin/bash mysql_install_db --user=root mysqld_safe --user=root & sleep 8 mysqladmin -u root password 'root' mysql -uroot -proot -e "grant all on *.* to 'root'@'%' identified by 'root';flush privileges;" mysql -uroot -proot -e "source /opt/pig.sql;source /opt/pig_codegen.sql;source /opt/pig_config.sql;source /opt/pig_job.sql;"
|
1 2 3 4 5 6
| [root@node-szzjs002-1958801-g3yaw Pig]# cat local.repo [pig] name=pig baseurl=file:///root/yum gpgcheck=0 enabled=1
|
容器化部署Redis
1 2 3 4 5 6 7 8 9 10 11
| [root@node-szzjs002-1958801-g3yaw Pig]# cat Dockerfile-redis FROM centos:centos7.9.2009 MAINTAINER Chinaskill RUN rm -rf /etc/yum.repos.d/* ADD local.repo /etc/yum.repos.d/ copy yum /root/yum RUN yum install -y redis RUN sed -i 's/bind 127.0.0.1/bind 0.0.0.0/g' /etc/redis.conf RUN sed -i 's/protected-mode yes/protected-mode no/g' /etc/redis.conf EXPOSE 6379 CMD ["/usr/bin/redis-server","/etc/redis.conf"]
|
容器化部署Pig
1 2 3 4 5 6 7 8 9 10 11
| [root@node-szzjs002-1958801-g3yaw Pig]# cat Dockerfile-pig FROM centos:centos7.9.2009 MAINTAINER Chinaskill RUN rm -rf /etc/yum.repos.d/* ADD local.repo /etc/yum.repos.d/ copy yum /root/yum RUN yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel ADD pig_init.sh /root/ RUN chmod +x /root/pig_init.sh EXPOSE 8848 9999 3000 4000 CMD ["/bin/bash","/root/pig_init.sh"]
|
1 2 3 4 5 6 7 8 9 10
| [root@node-szzjs002-1958801-g3yaw Pig]# cat pig_init.sh #!/bin/bash sleep 20 nohup java -jar /root/pig-register.jar $JAVA_OPTS >/dev/null 2>&1 & sleep 20 nohup java -jar /root/pig-gateway.jar $JAVA_OPTS >/dev/null 2>&1 & sleep 20 nohup java -jar /root/pig-auth.jar $JAVA_OPTS >/dev/null 2>&1 & sleep 20 nohup java -jar /root/pig-upms-biz.jar $JAVA_OPTS >/dev/null 2>&1
|
容器化部署前端服务
1 2 3 4 5 6 7 8 9 10 11 12
| [root@node-szzjs002-1958801-g3yaw Pig]# cat Dockerfile-nginx FROM centos:centos7.9.2009 MAINTAINER Chinaskill RUN rm -rf /etc/yum.repos.d/* ADD local.repo /etc/yum.repos.d/ copy yum /root/yum RUN yum install -y nginx COPY nginx/dist /data ADD nginx/pig-ui.conf /etc/nginx/conf.d/ RUN /bin/bash -c 'echo init ok' EXPOSE 80 CMD ["nginx","-g","daemon off;"]
|
编排部署Pig快速开发平台
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| [root@node-szzjs002-1958801-g3yaw Pig]# cat docker-compose.yaml version: '2' services: pig-mysql: environment: MYSQL_ROOT_PASSWORD: root restart: always container_name: pig-mysql image: pig-mysql:v1.0 ports: - 3306:3306 links: - pig-service:pig-register pig-redis: image: pig-redis:v1.0 ports: - 6379:6379 restart: always container_name: pig-redis hostname: pig-redis links: - pig-service:pig-register pig-service: ports: - 8848:8848 - 9999:9999 restart: always container_name: pig-service hostname: pig-service image: pig-service:v1.0 extra_hosts: - pig-register:127.0.0.1 - pig-upms:127.0.0.1 - pig-gateway:127.0.0.1 - pig-auth:127.0.0.1 - pig-hou:127.0.0.1 stdin_open: true tty: true privileged: true pig-ui: restart: always container_name: pig-ui image: pig-ui:v1.0 ports: - 8888:80 links: - pig-service:pig-gateway
|