A
A
Anton_volkov2018-01-19 11:09:28
LAMP
Anton_volkov, 2018-01-19 11:09:28

What is the best way to install php mysql apache in docker?

Ready kits from docker? Or is it better to install them separately?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jar3b, 2018-02-17
@jar3b

- MySql - in a separate way, you can then assemble it into one via docker-compose (or via docker swarm stack). You only need to read about stateful in advance and set up volumes.
- A separate image with code, install php there, maybe apache (or better nginx). You can use this image: https://hub.docker.com/r/tutum/apache-php/ or any similar image as a base if you don't want to install everything yourself. Then it describes how to do it, in short: we specify this image in our Dockerfile in `FROM`, and then we put our php files there via `COPY`/`ADD`. We collect, we push in the register.
- Display ports, for MySQL locally, for apache / nginx outside.
Specifically on your question: take mysql from dockerhub, push your image (there will already be both php and apache / nginx in it) into the local docker-registry first, and then pick it up from there during deployment.
You can install MySQL on the host, whichever is better - decide for yourself, based on the task.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question