1

I'm trying to deploy an web app in a VM instance at Google Compute Engine (GCP). I connect to instance via ssh and deployed docker-compose orchestrated app. Which runs two docker containers as below.

CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS               
6824c19fad9b        wordpress:latest    "docker-entrypoint.s…"   3 hours ago         Up 22 seconds       0.0.0.0:8065->80/tcp   
3079c9872e3d        mysql:5.7           "docker-entrypoint.s…"   3 hours ago         Up 3 hours          3306/tcp

As per my previous experiences I mapped host instance's port 8065 to the wordpress container's port 80 (which works fine on my local machine and some other machines) So as you could see above docker has properly done the mapping I assume.

To test the setup from the instance, when I run curl http://localhost:8065
the terminal responds curl: (52) Empty reply from server

Since I can't make the internal mapping work, its useless to map from outside also. However I've made new ingress and egress firewall rules to enable tcp:8065 for this instance. However still no luck.

I'm aware that GCP recommends to use their Kubernates Engine to deploy containerized apps. However switching to that option is not the solution I'm expecting here. I just want to make sure what went wrong and how to make the current setup work in the same platform.

inckka
  • 191
  • 10
  • Empty reply from server seems to hint that the port is open, but the web server instance inside the container is not returning any useful data. It doesn't look like a networking problem. – Luca Gibelli May 05 '18 at 07:52
  • @LucaGibelli You are correct. This was an issue with the Wordpress and db docker setup and apache2 doesn't start on docker. To debug the issue I ran `docker-compose up` without `-d` so it reflects mosts of the issues. Thanks for pointing me to that direction. – inckka May 07 '18 at 06:53
  • @inckka Can you write down a proper answer explaining what it was failing? It can be extremely useful for future user coming across this question looking why their Wordpress and db docker setup is not working! – GalloCedrone May 14 '18 at 11:44

2 Answers2

1

This was an issue with the Wordpress and DB Docker setup; apache2 wasn't starting inside docker container.

To debug the issue I ran docker-compose up without -d so it reflects most of the issues.

Wojtek_B
  • 931
  • 3
  • 12
0

You should "Allow HTTP traffic" and "Allow HTTPS traffic".

Go to your VM Instances, edit the instance and check the "Allow HTTP traffic" and "Allow HTTPS traffic" boxes. It will map outside VM traffic to it, and docker will handle it internally.