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