https://www.docker.com/products/docker-desktop Please execute the download according to your environment (win, mac).
Check if it is installed safely with the following command
docker -v
You now have Docker Engine on your local machine.
So, if you don't start it, it's meaningless, so please start Docker. Probably if there is a whale icon somewhere, it is running.
Always keep in mind that working with Docker is ** an event in a virtual environment called Docker Engine **.
** "The environment is not built on the local host (PC), it is built on the Docker host (Engine)" **
e? python? Is there something wrong? Many people would have thought. I understand your feelings. But let's keep that feeling in our hearts. For the time being, to explain briefly, After this, you will also install a tool that assists Docker operation, That's a tool made in Python. Its name is ** "Docker Comopose" ** Python is quick to install it easily. ** Install "python3" and "python3-pip" ** respectively. https://www.python.org/
Check if it is installed safely with the following command
python3 -V
So let's introduce an assistant tool for Docker operation.
pip3 install docker-compose
Check if it is installed safely with the following command
docker-compose --version
Create it anywhere on your local PC and move to that directory. This time, let's call it "wp_test". It can be a command, manual with GUI, or whatever.
mkdir ~/wp_test
cd ~/wp_test
What is this? I think it feels like that. As the name suggests, it is ** a Docker compose configuration file written in YAML format **. For the time being, create and save with the following contents with an editor, and place it in the corresponding directory created earlier.
docker-compose.yml
version: "3"
services:
wordpress-db:
image: mysql:5.7
networks:
- wordpressnet
volumes:
- wordpress_db_volume:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: myrootpassword
MYSQL_DATABASE: wordpressdb
MYSQL_USER: wordpressuser
MYSQL_PASSWORD: wordpresspass
wordpress-app:
depends_on:
- wordpress-db
image: wordpress
networks:
- wordpressnet
ports:
- 8080:80
restart: always
environment:
WORDPRESS_DB_HOST: wordpress-db
WORDPRESS_DB_NAME: wordpressdb
WORDPRESS_DB_USER: wordpressuser
WORDPRESS_DB_PASSWORD: wordpresspass
networks:
wordpressnet:
volumes:
wordpress_db_volume:
Let's start the container with this setting for the time being. Be sure to run it in the directory where docker-compose.yml is located.
cd ~/wp_test
docker-compose up -d
http://localhost:8080/
You should see the initial Wordpress installation screen.
Confirmation of container startup with command
docker-compose ps
You should see the container you are running.
docker-compose down
You may hear a voice saying, "Hey, you can't recover the hints by running like this!" Time is also time, so this time it's up to here. For the time being, try setting up Wordpress in this state and play around with it. Then, various problems will come up. Then see you again.
Recommended Posts