DockerCompose方式部署springboot前后端分离项目

服务编排方式部署

以下文件具体目录

DockerCompose方式部署springboot前后端分离项目

1、构建springboot后台服务dockerfile文件,vim /usr/local/docker/soc/Dockerfile

FROM jdk:8MAINTAINER sinvie.cnADD ScgService.jar /root/ScgService.jarENTRYPOINT ["nohup","java","-jar","/root/ScgService.jar","&"]

2、利用Docker Compose 搭建 后台服务 ,vim /usr/local/docker/soc/docker-compose.yml

version: "1.0"?services:?  redis:    image: redis:5.0    container_name: redis50    volumes:      - /usr/local/docker/redis50/conf/redis.conf:/etc/redis/redis.conf      - /usr/local/docker/redis50/data:/data    command:      - redis-server      - /etc/redis/redis.conf    ports:     - 6379:6379?  mysql:    image: mysql:5.7.30    container_name: mysql57    volumes:      - /usr/local/docker/mysql57/conf/my.cnf:/etc/mysql/my.cnf      - /usr/local/docker/mysql57/data:/var/lib/mysql      - /usr/local/docker/mysql57/logs:/logs    environment:      MYSQL_ROOT_PASSWORD: 123456    ports:      - 3306:3306     soc:    build: /usr/local/docker/soc    container_name: soc    depends_on:        - mysql        - redis    ports:        - 8888:8888

3、运行docker-compose.yml

docker-compose -p zongzhi -f docker-compose.yml up -d

4、安装nginx镜像

 参考上一篇

5、安装fastdfs镜像

 参考https://www.jianshu.com/p/1038b4d95912

相关推荐