A local project scaffold for getting up and running quickly with a Roots/Bedrock project over Docker Compose
- Docker Desktop (Win/OSX/Linux)
- Composer
NOTE: composer
commands can also be substituted for the official
Composer Docker Image.
All commands in this README assume that Composer is installed natively on your system
All references to <project-name>
can be replaced with the name of your project.
- Run
composer create-project maiorano84/bedrock-project <project-name> && cd <project-name>
- Replace any variables in the
.env
file with your own configuration - Run
docker-compose up -d
Once complete, your Bedrock site will be available at http://localhost
A separate configuration has been provided to enable pretty URLs through Traefik
If you would like to use custom URLs, then you will need to prepare an external Docker Network and ensure that no other services are running on your host's Port 80 (ie: NGINX, Apache, etc.).
Preparing the Traefik network is only necessary once. Once these commands are complete, any subsequent Bedrock projects running the Traefik configuration will automatically be served over that network.
Once the network and the Traefik container are both up and running, you can run the project
with the following: docker-compose -f traefik.yml up -d
Once complete, your Bedrock site will be available at http://${NGINX_SERVER_NAME}
The provided commands will get you quickly set up with a simple base installation that should cover most of your needs. For additional options, see the Static Configuration Documentation
docker network create -d bridge traefik-network
docker run -d -p 80:80 -p 443:443 -p 8080:8080 \
-v /var/run/docker.sock:/var/run/docker.sock \
--name=traefik \
--restart unless-stopped \
--network=traefik-network \
-l traefik.enable=false \
traefik:2.4 \
--providers.docker=true \
--api.insecure=true \
--entrypoints.web.address=:80 \
--entrypoints.websecure.address=:443
Once running, you may also access the Traefik Dashboard by navigating to http://localhost:8080
Some command line tools are available as Compose services to make life a little easier:
To run a CLI command as a service, simply run the following:
docker-compose -f cli.yml run --rm <service>...