Development Setup
Get the code at github.com/hivecache
Requirements
This project uses docker-starter and castor for ease of developer experience.
A Docker environment is provided and requires you to have these tools available:
- Docker
- Bash
- Castor
Docker Environment
The Docker infrastructure provides a web stack with:
- NGINX
- PostgreSQL
- PHP
- Traefik
- A container with some tooling:
- Composer
- Node
Domain Configuration (First Time Only)
Before running the application for the first time,
ensure your domain names point to the IP of your Docker daemon by editing your /etc/hosts file.
This IP is probably 127.0.0.1 unless you run Docker in a special way.
echo '127.0.0.1 hivecache.test server2.hivecache.test app.hivecache.test docs.hivecache.test mail.hivecache.test' | sudo tee -a /etc/hosts
Starting the Stack
Launch the stack by running this command:
castor start
Note
The first start of the stack should take a few minutes.
The site is now accessible at the hostnames you have configured over HTTPS
(you may need to accept self-signed SSL certificate if you do not have mkcert installed on your computer - see below).
SSL Certificates
HTTPS is supported out of the box.
SSL certificates are not versioned and will be generated the first time you start the infrastructure (castor start)
or if you run castor docker:generate-certificates.
If you have mkcert installed on your computer, it will be used to generate locally trusted certificates.
See mkcert documentation to understand how to install it.
Do not forget to install CA root from mkcert by running mkcert -install.
If you don’t have mkcert, then self-signed certificates will instead be generated with openssl.
You can configure infrastructure/docker/services/router/openssl.cnf to tweak certificates.
You can run castor docker:generate-certificates --force to recreate new certificates if some were already generated.
Remember to restart the infrastructure to make use of the new certificates with castor build && castor up or castor start.
Builder Container
Having some composer, yarn or other modifications to make on the project? Start the builder which will give you access to a container with all these tools available:
castor builder
Other Tasks
Checkout castor to have the list of available tasks.
Server2
There is a second server set up, it can be useful when testing scenario where you want to follow people from one server to another.
To use this server you can go to: https://server2.hivecache.test
Note that all castor command need the --context server2 option so they are sent to the right server.
Examples:
castor --context server2 fixtures
castor --context server2 builder