B
B
bernex2016-04-15 16:09:01
Docker
bernex, 2016-04-15 16:09:01

How to raise different versions of PHP on docker?

The task is this: there is mac os.
I want to set up the environment. I need to run the codes of different versions of a project. Under different php versions: 5.3, 5.4, 5.5, 5.6.
Each project version has its own mysql dump.
How convenient to lift to. Was it easy to run any version with any version of the project with the right dump raised? Or play on all?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Hukendo, 2016-04-18
@hukendo

Somehow like this. Just change the desired version of the image. And put your ways in volumes.

version: '2'
services:
  php:
    image: php:7.0.5-apache
    depends_on:
      - db
    ports:
      - 8080:80
    volumes:
      - /my/path/to/code:/var/www/html
  db:
    image: mariadb
    environment:
      MYSQL_ROOT_PASSWORD: wordpress

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question