Linode/lamp + docker-compose

admin

Administrator
Staff member
I want to install <a href="https://hub.docker.com/r/linode/lamp/" rel="nofollow">linode/lamp</a> container to work on some wordpress project locally without messing up my machine with all the lamp dependencies.

I followed <a href="https://www.linode.com/docs/applications/containers/how-to-install-docker-and-deploy-a-lamp-stack" rel="nofollow">this tutorial</a> which worked great (it's actually super simple).

Now I'd like to use
Code:
docker-compose
because I find it more convenient to simply having to type
Code:
docker-compose up
and being good to go.

Here what I have done:

Dockerfile:

Code:
FROM linode/lamp
RUN service apache2 start
RUN service mysql start

docker-compose.yml:

Code:
web:
  build: .
  ports:
    - "80:80"
  volumes:
    - .:/var/www/example.com/public_html/

When I do
Code:
docker-compose up
, I get:

Code:
▶ docker-compose up
Recreating gitewordpress_web_1...
Attaching to gitewordpress_web_1
gitewordpress_web_1 exited with code 0
Gracefully stopping... (press Ctrl+C again to force)

I'm guessing I need a command argument in my
Code:
docker-compose.yml
but I have no idea what I should set.

Any idea what I am doing wrong?