标签:load var boot spring add 部署 mys depends point
以下文件具体目录
1、构建springboot后台服务dockerfile文件,vim /usr/local/docker/soc/Dockerfile
FROM jdk:8
MAINTAINER sinvie.cn
ADD ScgService.jar /root/ScgService.jar
ENTRYPOINT ["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镜像
参考上一篇
DockerCompose方式部署springboot前后端分离项目
标签:load var boot spring add 部署 mys depends point
原文地址:https://www.cnblogs.com/caohanren/p/13041095.html