- Building Web Apps with Spring 5 and Angular
- Ajitesh Shukla
- 177字
- 2021-07-02 19:38:28
Docker compose script to set up the development environment
Now that we have set up both Tomcat and MySQL as individual containers, let's create a Docker compose script using which both the containers can be started simultaneously, thereby, starting the Dev environment.
- Save the following source code as docker-compose.yml in the same folder as the aforementioned files:
version: '2' services: web: build: context: . dockerfile: tomcat.df ports: - "8080:8080" volumes: - .:/mnt/ links: - db db: image: mysql:5.7 ports: - "3326:3306" environment: - MYSQL_ROOT_PASSWORD=r00t
- Execute the following command to start and stop the services:
// For starting the services in the foreground docker-compose up // For starting the services in the background (detached mode) docker-compose up -d // For stopping the services docker-compose stop
- Test whether both the default Tomcat web app and MySQL server can be accessed. Access the URL 192.168.99.100:8080, and make sure that the web page as shown in Figure 1.20 is displayed. Also, open MySQL Workbench and access the MySQL server at IP 192.168.99.100 and port 3326 (as specified in the preceding docker-compose.yml file).
推薦閱讀
- Django+Vue.js商城項(xiàng)目實(shí)戰(zhàn)
- AngularJS Testing Cookbook
- iOS 9 Game Development Essentials
- Python數(shù)據(jù)分析基礎(chǔ)
- C# Programming Cookbook
- Developing Middleware in Java EE 8
- C#程序設(shè)計(jì)教程
- Building a Quadcopter with Arduino
- 軟件測(cè)試技術(shù)指南
- RSpec Essentials
- Scala Reactive Programming
- Mastering Linux Security and Hardening
- Django 3.0入門與實(shí)踐
- Django 3.0應(yīng)用開(kāi)發(fā)詳解
- 青少年學(xué)Python(第2冊(cè))