jbfink / docker-wordpress

Dockerfile and etc for a Wordpress docker image
The Unlicense
276 stars 120 forks source link

port 80 not working for me #1

Closed jots closed 11 years ago

jots commented 11 years ago

This is my first docker container so I'm probably doing something wrong:

The process is running: docker ps ID IMAGE COMMAND CREATED STATUS PORTS 885609d82b0a joe/wordpress:latest /bin/bash /start.sh 6 minutes ago Up 6 minutes 49154->80

but if I try to connect I get "connection refused"

I also try docker attach 885609d82b0a but it just hangs.

I can connect using the other port: i.e. lynx localhost:49154 works and brings me to the WP install page.

what do I need to do to make it work on port 80? and how can i open a shell onto that contatiner (attach?)?

jbfink commented 11 years ago

Hi jots, thanks for trying out my Wordpress container.

I purposefully do not launch the container on a fixed port on the host box, but you can easily override this behaviour by issuing a -p to docker run -- e.g., to assign port 80 on the container to port 80 on the host you'd do something like this:

docker run -p :80 -d jbfink/wordpress

If, say, you wanted to make port 5000 on your host forward to port 80 on your container you'd do this:

docker run -p 5000:80 -d jbfink/wordpress

As for your second question, by default my wordpress image doesn't have a shell, but you can easily create a container from the image and run a shell by doing:

docker run -i -t jbfink/wordpress /bin/bash

I have tossed around the idea of having an sshd daemon run along with the apache and wordpress stuff, but I haven't done that.

Hope that helps!