craftcms/craft

Consider adding configuration for Docker?

Closed this issue · 4 comments

This is not really an issue, more of a discussion.

Would adding a Dockerfile or docker-compose.yml be an option/pull request that would be considered? Meaning that if a docker-compose.yml file, that contained an official PHP, MySQL and Postgres configuration, were to be added to this repository - would this be worth it to anyone?

Even if the end result is that the developer/project/installer decides not to use Docker, it would be a painless addition and take a minimal amount of effort to remove from their installation.

A quick example, not tested at all, would be a docker-compose.yml file that looks something like this:

version: '2'
services:

    craftcms:
        image: php/7.0-apache
        ports:
            - "80:80"
        depends_on:
            - mysql-server
        links:
            - mysql-server
        volumes:
            - ".:/var/www"
        env_file: .env

    mysql-server:
        image: mysql/5.7
        ports:
            - "3306:3306"
        volumes:
            - "./storage/database:/var/lib/mysql"
        environment:
            MYSQL_ROOT_PASSWORD: SuperLongPassword!
            MYSQL_DATABASE: dev_craftcms
            MYSQL_PASSWORD: Password1!
            MYSQL_USER: craftcms
            MYSQL_ALLOW_EMPTY_PASSWORD: "no"

Down for this, it's just a matter of timing (and supporting it) for us. Most likely something we'll look into again after 3.0 GA.

Since 3.0 is now released, will you consider a PR with a Docker setup?

@jasonmccallister 100% - feel free to submit. Want to get an official one up sooner than later. Someone grabbed https://hub.docker.com/u/craftcms so trying to make contact and see what we can do to get it.

Pulling from a craftcms image makes sense, but we find it a good practice to build our image based on an upstream build, in the example PHP 7.3, but we could switch to craftcms/php-7.3-postgres? Not sure on the naming... but only installing the deps for postgres or mysql depending on the image.