NGINX/PHP/MySQL/PgSQL/Redis/Mailpit
Tested on macOS (Intel / Apple Silicon), Linux (x86_64 / aarch64) / Windows 10/11 (x86_64) over WSL
Supported CMS and Frameworks: Symfony, Laravel, Yii v1/v2, Magento v1/v2, OroCommerce/OroCRM/OroPlatform, AkeneoPIM, Wordpress, and more
- Macos
xcode-select --install
- Linux (Ubuntu/Debian)
sudo apt install -yq curl git patch systemtap-sdt-dev build-essential python3
- Linux (OpenSUSE 15+)
sudo zypper install curl git patch systemtap-sdt-devel gcc python3orsudo transactional-update pkg install curl git patch systemtap-sdt-devel python3 gcc
- Linux (Fedora 40+)
sudo dnf install -y curl git patch systemtap-sdt-devel python3sudo dnf groupinstall -y "Development Tools" "Development Libraries"
- Windows (10/11)
- Enable WSL2
- Install one of supported Linux OS from Windows Store
- Follow related Linux steps
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"BREW_BIN=$(find /opt/homebrew/bin /usr/local/bin /home/linuxbrew/.linuxbrew/bin -name "brew" 2> /dev/null); [ -f "${BREW_BIN}" ] \
&& (echo; echo 'eval "$('${BREW_BIN}' shellenv)"') | tee -a $HOME/.zprofile | tee -a $HOME/.bashrc \
&& eval "$(${BREW_BIN} shellenv)"brew tap digitalspacestdio/common
brew trust digitalspacestdio/commonbrew tap digitalspacestdio/ngdev
brew trust digitalspacestdio/ngdevbrew tap digitalspacestdio/php
brew trust digitalspacestdio/phpbrew install digitalspace-supervisor digitalspace-nginx digitalspace-traefik digitalspace-dnsmasq digitalspace-allutilsThe latest release version
brew install php-commonOptionally install additional versions
brew install php81-common php74-common php56-commonselect any of version you need just by changing the name to
phpXX-common, where XX is the first two numbers of the php version without dots available versions:8.4,8.3,8.2,8.1,8.0,7.4,7.3,7.2,7.1,7.0,5.6
brew install composer@2RedisDB
brew install digitalspace-redisPostgreSQL 15
brew install digitalspace-postgresql15MySQL 8.0
brew install digitalspace-mysql84MySQL 5.7
brew install digitalspace-mysql57Mailpit (catches outgoing mail on 127.0.0.1:1025, web UI at http://127.0.0.1:8025)
brew install digitalspace-mailpitsudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain $(brew --prefix)/etc/openssl/localCA/root_ca.crt# Create folder
sudo mkdir /usr/local/share/ca-certificates/extra
# Copy the CRT cert
sudo cp $(brew --prefix)/etc/openssl/localCA/root_ca.crt /usr/local/share/ca-certificates/extra/
# Reconfigure
sudo dpkg-reconfigure ca-certificates
# Update
sudo update-ca-certificates
# Update NSS Storage (required for Chrome Browser)
# Install tools
sudo apt install libnss3-tools
# Create database
mkdir -p $HOME/.pki/nssdb
certutil -d $HOME/.pki/nssdb -N
certutil -d sql:$HOME/.pki/nssdb -A -t "C,," -n "Local Development" -i $(brew --prefix)/etc/openssl/localCA/root_ca.crt
# Check NSS Storage
certutil -d sql:$HOME/.pki/nssdb -L# Convert CRT to PEM
openssl x509 -in $(brew --prefix)/etc/openssl/localCA/root_ca.crt -out $(brew --prefix)/etc/openssl/localCA/root_ca.pem -outform PEM
# Move the PEM cert
sudo mv $(brew --prefix)/etc/openssl/localCA/root_ca.pem /etc/pki/ca-trust/source/anchors/
# Update the CA trust
sudo update-ca-trust
If you want re-generate the root certificate you need to remove certificates folder by following command:
rm -rf $(brew --prefix)/etc/openssl/localCAand resinstall thedigitalspace-local-caformula:brew uninstall --ignore-dependencies digitalspace-local-ca && brew install digitalspace-local-ca
digitalspace-dnsmasq-startdigitalspace-supervisor-startdigitalspace-supctl statusCreate the new project dir in following path: ~/www/dev/hello/%2nd_level_domain%/%3rd_level_domain%
mkdir -p ~/www/dev/helloBy default dns and web-server configured for domains in the
.dev.localpool
Create index.php
echo '<?php phpinfo();' > ~/www/dev/hello/index.phpOpen https://hello.dev.local/ in the browser and check the result
On macOS if you want to expose docker containers with *.docker.local domain by docker labeles you will needed to start second traefik instance inside the docker and proxy requests from local instance.
To create config on the local traefik just run
digitalspace-traefik-enable-docker-proxyThen you need to start traefik instance inside the docker which will watch for containers and them labels, just use this compose yaml:
# docker-compose.yml
services:
traefik_docker_local:
hostname: traefik.docker.local
image: traefik:v2.11
container_name: traefik_docker_local
command:
- "--ping=true"
- "--log.level=DEBUG"
- "--api=true"
- "--api.dashboard=true"
- "--experimental.plugins.rewrite-body.modulename=github.com/packruler/rewrite-body"
- "--experimental.plugins.rewrite-body.version=v1.2.0"
- "--experimental.plugins.cookiePathRewrite.modulename=github.com/vnghia/traefik-plugin-rewrite-cookie-path"
- "--experimental.plugins.cookiePathRewrite.version=v0.0.1"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.default.address=:80"
- "--entrypoints.default.forwardedheaders.trustedips=0.0.0.0/0"
- "--entryPoints.default.forwardedHeaders.insecure"
restart: always
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
ports:
- "${TRAEFIK_BIND_ADDRESS:-0.0.0.0}:${TRAEFIK_BIND_PORT:-8880}:80"
networks:
- "shared"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
labels:
traefik.enable: 'true'
traefik.http.routers.traefik-api.rule: 'PathPrefix(`/traefik/dashboard`) || (PathPrefix(`/api`) && HeadersRegexp(`referer`, `/traefik/dashboard`))'
traefik.http.routers.traefik-api.priority: 9000
traefik.http.routers.traefik-api.entrypoints: "default"
traefik.http.routers.traefik-api.service: "api@internal"
traefik.http.routers.traefik-api.middlewares: "traefik-api-stripprefix"
traefik.http.middlewares.traefik-api-stripprefix.stripprefix.prefixes: "/traefik"
healthcheck:
test: traefik healthcheck --ping
start_period: 5s
interval: 5s
retries: 30
networks:
shared:
name: dc_shared_net
external: true