![]() You will see an installer file called MAMP_2.1.4.pkg (your version may be different) – double-click that file to run the installer. ![]() Once the download is complete, double-click the zip file and extract the contents to your desktop. ![]() The installer package is around 140mb, so it will take a few minutes for the download to complete. There is also a MAMP Pro version available which has more advanced options, but most users will find the free version works fine for their needs. This article will walk you through the steps to install MAMP on your computer.ĭownload the installer package for the latest free version of MAMP by clicking on the gray elephant icon on the left, and save the file to your computer. I’m happy with this setup and I hope you can benefit from this article.MAMP is a local server package which runs on a Mac, similar to packages for Windows and Linux, and is easy to set up and configure. It’s also more clear where data lives and although Docker needs a cleanup once in a while too, I do not get bloated with many source packages which sleep somewhere on my disk. In conclusion: Docker helped me save disk space and administration time I would otherwise spend using brew or port. If I would want to switch PHP version, that would only be a matter of changing the docker-compose.yml file and let Docker do the job, instead of needing to build from source using Xcode command line tools and wait for brew or port to finish. In this case that is plain mariadb as you can reference the one container from the other when they’re configured in one compose file.įrom a wp-config.php: /** MySQL hostname */ Be aware that since WordPress is running in the PHP-Apache container, it should use the Docker runtime host for the MariaDB to connect to the database. I use this setup for websites I develop for clients, which are usually WordPress websites. One could do the same with the configuration file of phpmyadmin: store it in the _docker directory and map it to a path in the container./_docker/ Also, to persist the MariaDB databases, I’ve configured a Docker volume in order to keep my databases after a turn down of the container. ![]() version: '3' services: web: image: php74:latest ports: - '80:80' volumes: - /Users/vincentb/Sites/_docker/apache:/etc/apache2/sites-enabled - /Users/vincentb/Sites:/var/depends_on: - mariadb extra_hosts: - 'ax710.test:127.0.0.1' # - 'some-other-host.test:127.0.0.1' networks: - dev-env phpmyadmin: image: phpmyadmin:latest ports: - 8080 :80 environment: - PMA_ARBITRARY=1 - PMA_HOST=mariadb depends_on: - mariadb volumes: - /Users/vincentb/Sites/_docker/php/php.ini:/usr/local/etc/php/php.ini networks: - dev-env mariadb: image: mariadb:latest restart: always environment: MYSQL_ROOT_PASSWORD: 'secret' MYSQL_USER: 'vincentb' MYSQL_PASSWORD: 'secret' MYSQL_DATABASE: 'vincentb' volumes: - mysqldata: /var/lib/mysql ports: - 3306 :3306 networks: - dev-env volumes: mysqldata: Īs you can see I also have a php.ini file outside of the docker to persist PHP-specific configuration. One running Apache with Php74 and one with MariaDB, the real open source alternative to MySQL and one with PhpMyAdmin. With one command the compose file starts up three Docker containers. # before: /Users/vincentb/Sites/ # after: Options FollowSymLinks DocumentRoot "/var/www/html/" ServerName localhost I copied over the Apache configuration file from the former setup and only had to change all directory paths which map to the volumes directive in the Docker configuration. It uses Docker Compose which is basically a Yaml file with all we need. It took me quite some time before I got on the Docker boat □īasically I have a subdirectory in my ~/Sites directory which contains all Docker configuration. Her video, and a couple of results from Google, say the better tutorial blog post on Docker, resulted in the following setup and configuration. She has a great course on YouTube which lasts about 3 hours (2 hours on 1.5 the speed) digging deep into all features of Docker. I thought the learning curve was too steep, but that wasn’t actually true. I had heard about Docker a couple of years ago but I never had used it. ![]() I was fed up with dealing with a lot of administration with regard to running MacPorts and Homebrew: clean up, update, upgrade… Besides they took up a lot of disc space and I regularly had to clean up my MacBook in order to retain enough room for other applications. I deleted both and wrote a docker-compose.yml with about 50 SLOC that’s easier to maintain and easy to set up. But I found out both use an aweful lot of diskspace. I had both Macports and Homebrew installed… Why? I can’t recall actually. I was cleaning up my laptop as I had only 6Gb left on my 2013 MacBook Pro. This article describes a way to set up a MAMP development environment with Docker, Apache, PHP and MariaDB (i.e. MySQL). It took me quite some time before I got on the Docker boat (pun intended), but since last few weeks, I’m totally in. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |