-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95bc894
commit 4a42490
Showing
5 changed files
with
102 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2020 Matt Maiorano | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Bedrock Project | ||
|
||
A project scaffold for getting up and running quickly with | ||
a [Roots/Bedrock](https://roots.io/bedrock/) project over Docker Compose | ||
|
||
# Requirements | ||
|
||
* [Docker Desktop](https://www.docker.com/products/docker-desktop) (Win/OSX/Linux) | ||
* [Composer](https://getcomposer.org/) | ||
|
||
**NOTE**: `composer` commands can also be substituted for the official | ||
[Composer Docker Image](https://hub.docker.com/_/composer). | ||
|
||
All commands in this README assume that Composer is installed natively on your system | ||
|
||
# Basic Usage | ||
|
||
All references to `<project-name>` can be replaced with the name of your project. | ||
|
||
1. Run `composer create-project maiorano84/bedrock-project <project-name> && cd <project-name>` | ||
2. Replace any variables in the `.env` file with your own configuration | ||
3. Run `docker-compose up -d` | ||
|
||
Once complete, your Bedrock site will be available at http://localhost | ||
|
||
# Pretty URLs | ||
|
||
A separate configuration has been provided to enable pretty URLs through | ||
[Traefik](https://traefik.io/) | ||
|
||
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 docker-compose.traefik.yml up -d` | ||
|
||
Once complete, your Bedrock site will be available at `http://${NGINX_SERVER_NAME}` | ||
|
||
# Setting up Traefik | ||
|
||
The provided Traefik configuration is set up to respond to `*.docker.localhost` and will | ||
automatically proxy requests to the running NGINX configuration. | ||
|
||
## Network | ||
|
||
``` | ||
docker network create -d bridge traefik-network | ||
docker build -t traefik-web ./docker/traefik | ||
``` | ||
|
||
## Container | ||
|
||
``` | ||
docker run -itd --restart unless-stopped \ | ||
-p 80:80 -p 8080:8080 \ | ||
-v /var/run/docker.sock:/var/run/docker.sock \ | ||
--name=traefik --network=traefik-network traefik-web | ||
``` | ||
|
||
Once running, you may also access the Traefik Dashboard by navigating to http://localhost:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM traefik:2.2 | ||
COPY ./traefik.yml /etc/traefik/traefik.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
## traefik.yml | ||
|
||
# Docker configuration backend | ||
providers: | ||
docker: | ||
defaultRule: "Host(`{{ trimPrefix `/` .Name }}.docker.localhost`)" | ||
|
||
# API and dashboard configuration | ||
api: | ||
insecure: true | ||
|
||
entryPoints: | ||
web: | ||
address: ":80" | ||
websecure: | ||
address: ":443" |