Preparing the baseline code
Now, we need to prepare our baseline code, a process very similar to what we did in the previous chapter. Let's follow these steps:
- Copy all the content from the
chapter-08folder. - Rename the folder to
chapter-09. - Delete the
storage-dbfolder.
Now, let's make some changes to the docker-compose.yml file so that it can fit a new database and server containers.
Open
docker-compose.ymland replace its content with the following code:
version: "3.1"
services:
mysql:
image: mysql:5.7
container_name: chapter-09-mysql
working_dir: /application
volumes:
- .:/application
- ./storage-db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_DATABASE=chapter-09
- MYSQL_USER=chapter-09
- MYSQL_PASSWORD=123456
ports:
- "8083:3306"
webserver:
image: nginx:alpine
container_name: chapter-09-webserver
working_dir: /application
volumes...