Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

152
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda