Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
How can I separate wordpress in backend & frontend with docker container?

I've created two containers for this using the following commands:

docker run --detach --name=test-mysql --env="MYSQL_ROOT_PASSWORD=mypassword" mysql

and, with the command docker inspect test-mysql I can see the containers IP address "IPAddress": "172.17.0.20",

After that, I'm trying to connect it with mysql but I get this error:

can't connect to MySQL server on '172.17.0.20' (60) 

but if I do: "docker exec -it test-mysql bash" I can connect it.

If I want to connect a front end for a wordpress to this mysql container, how should I do it?

I tried with docker run --detach --name test-wordpress --link test-mysql:mysql wordpress but is not working and I have nothing in localhost:80 enter image description here

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You must expose the ports using -p on docker run command. You can map ports from your container to be accessed from your host:

docker run --detach -p 3306:3306 --name=test-mysql --env="MYSQL_ROOT_PASSWORD=mypassword" mysql

The same for wordpress using -p 80:80

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!