dev/ to your project, including the "hidden" directory .docker-config/. Our setup comes with a mix of containers that fit our development needs, but you can remove or replace them in the docker-compose-* files.docker-compose.yml, .docker-config/php-xdebug.ini and .docker-data/ to your project's .gitignoredocker-compose.yml. For example, if you're running Linux, you copy or symlink the docker-compose-linux.yml file to docker-compose.yml.~/.bashrc, ~/.bash_profile or some other script that runs on shell startup:
export DOCKER_UID=$(id -u)
export DOCKER_GID=$(id -g)
docker-compose build. If you're on Linux and need to use sudo to build the image, run sudo -E docker-compose build to pass the environment variables you set earlier.docker-compose upYour host already has an application running on the specified port. Most likely, you have web/MySQL/Browsersync running outside of docker and using the same port. You have a couple of options:
Mac OS has pretty slow file sharing with Docker and in most cases we suggest installing nvm and yarn on the host and running the watcher on the host. If you want to use our wildacrd SSL certificate, you can either copy it from one of the docker images or from our Git repository. The key and certificates are located in /etc/ssl/docker/.
If you are determined to run the watcher inside Docker, you can try using Docker CE Edge and setting up caching for the /app volume.
file not found or cannot start service on OSXIf your project is outside of /Users, you will need to add it to the shared directories in Docker settings.
docker-compose exec web composer installphp.ini and vhost.conf files in .docker-config/.nvmrc containing the node version that you want (for example v8.8.0)docker-compose run --rm nodejs nvm install.docker-compose run --rm nodejs npm installConsider creating an alias for the first part of the command to make your life easier.
Our setup has all the basic services we need for a PHP based web project.
Apache is set up to run on standard ports: 80 for http and 443 for https. A valid (not self-signed) SSL certificate is included in our setup. It covers the wildcard *.loc-dev.com domain, which is also pointed to 127.0.0.1 on our DNS. This allows you to easily use a different subdomain for each of your projects and prevents a lot of browser caching issues.
Default PHP version in the container is 7.1 with pretty much all common modules installed and enabled. You can change the PHP version through the environment variable in your docker-compose.yml file and it will get switched on your next docker-compose up. You can also modify the php.ini file for your project in .docker-config/php.ini.
Xdebug is also set up, but it is turned off by default (for performance reasons). The default idekey is PHPSTORM, but you can change that and any other xdebug options by creating a .docker-config/php-xdebug.ini file and pointing the volume to it in your docker-compose.yml. Map your project root to /app in PhpStorm for mapping to work correctly.
PHP composer is also globally installed in the container so that you can easily manage your dependencies from within the container.
Default connection info for your application:
Hostname: web
Port: 80 for http or 443 for https (the certificate won't match the hostname)
Default connection info from the host:
Hostname: localhost, 127.0.0.1 or any subdomain of loc-dev.com
Percona MySQL is Percona's drop-in replacement for MySQL with a lot of great features and performance improvements that make it more practical in production environments. There are issues with the official image on Windows, so we use the Oracle MySQL on Windows only.
Default connection info for your applications:
db - communication between containers is done by using container names as domain names3306dbuserpassw0rd!d0ck3r!, in case your application has to have root level access to MySQL.Default connection info from the host:
localhost or 127.0.0.13306nvm (Node Version Manager) is used to install whichever Node.js version you need for the specific project. Once you choose your Node.js version for a project, we suggest that you write it in .nvmrc, so that all other developers can use that exact same version.
Yarn is installed globally in the container and set up to use the same Node.js you are using through nvm.
By default, the port 3000 is passed to the host, since it's the default port for Browsersync.
Mailcatcher is a mail (SMTP) server that doesn't pass any mail to the specified addresses, but catches them and displays them for testing and debugging in its web interface that is passed to port 1080 by default.
If you want to be able to send mail to Mailcatcher from your host, you can pass through port 25 in you docker-compose.yml files.
Default connection info for your applications:
mail25 for SMTPDefault connection info from the host:
localhost or 127.0.0.11080 for web interfaceContent type
Image
Digest
sha256:03e874d55…
Size
196.8 MB
Last updated
8 months ago
docker pull tbmatuka/nodejs-development