-
Clone this project
-
Go to setup folder
-
Setup the local environment using
PROJECT_PATH=path_to_your_new_project WP_INIT=yes and then run the command docker-compose up
- You need to provide the path to the project where the setup will create the new bedrock project via
PROJECT_PATH
variable WP_INIT
has to be set toyes
the first time in order to initialize the project (bedrock, sage,...), when omitted, the project will not be initialized and this assumes thatPROJECT_PATH
already contains bedrock project
- You need to provide the path to the project where the setup will create the new bedrock project via
Watching file changes is not working when using shared volumes in Docker native for windows 10. As workaroud, Watch polling must be enabled.
While polling can be easily enabled for larabel frontend by execusing watch-poll target (npm --prefix ${LARAVEL_PATH} run watch-poll
), we need to configure it manually for sage frontend by adding the following line in webpack.config.watch.js
devServer: {
watchOptions: {
poll: true
}
}
This section will guide you step by step how to provision production environment using an automated setup based on Terraform
- Install Terraform
- Generate AWS key/secret (If you already have that, skip this step) This guide to how to generate AWS keys
- Generate 2 ssh keys
- ssh key will be used to connect to EC2
- ssh key will be used to push code to Dokku You can also use the same ssh key for both connecting to EC2 and pushing code to Dokku This is guide to how to generate ssh key in Windows
- Open terminal, clone this project and go to aws provisioning folder
- Prepare variables. Check
variables.tf
to see full list of required variables, their default values and description- copy
secret.auto.tfvars.example
tosecret.auto.tfvars
. This file is intended to contains all secret variables and should not be versioned (it figures in.gitignore
btw) - Fill all the other non secret variables in
variables.tf
- copy
- Install AWS Terraform provider with
terraform init
- Tell Terraform that we are using modules and need to get them
terraform get
Now, we are ready to launch our stack, but before, it's good to verify the plan that Terraform is willing to execute
terraform plan
This command will display all the resource that Terraform will create/update/delete. It's good practice to check that before proceeding to running the plan
Run the plan
terraform apply
When Terraform finish AWS resources creation, the EC2 ip address will be printed in the console. You need to set your domain to that ip address in your DNS
Note that, even after Terraform finish, you need to wait for provision.sh
script to finish installing and configuring Dokku. To see the status of provision.sh
execution, check /var/log/cloud-init-output.log
log file
tail -f /var/log/cloud-init-output.log
I understand very well your queries, you shouldn't provision ec2 until you need it. If you comment ec2 module in main.tf (lines 8-29), terraform will provision only Amazon RDS. Uncomment them later when ec2 is needed. or better, you could directly target only rds module
terraform apply -target=module.rds
-
Go to the project folder
-
initialize git with
git init
-
set git remote to Dokku server
git remote add dokku dokku@$domain.tld:$wordpress
Replace:
- $domain.tld
- $wordpress with
app_name
set before invariables.tf
-
Commit changes
First time
git add -A .
git commit -am "my first commit"
git push dokku master
- Commit changes
git push dokku master