GithubHelp home page GithubHelp logo

docker-demo's Introduction

如何运行

进入项目根目录,执行

docker compose up -d

然后打开http://127.0.0.1:8000即可看到登录页面

如何连接数据库

compose.yaml将mysql端口映射到127.0.0.1:3307,连接参数见BookManager2/src/main/resources/application.properties,用户名为root, 密码为abc123,数据库名为book_manager
容器内已经导入了数据,使用任意数据库客户端(navicat, datagrip等)连接到容器内的数据库

整体架构

frontend

frontend容器使用nginx分发静态文件,同时反代后端接口
静态文件由vue项目打包形成

backend

backend容器使用openjdk运行后端项目打包形成的jar文件,需要连接到mysql和redis

mysql

mysql将数据挂载到了./database下,通过docker网络与backend容器通信,可以不暴露端口,为了方便查看数据库的表所以暴露了端口

redis

redis没有配置持久化,通过docker网络与backend容器通信,没有暴露端口

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.