Web Server
The web server container responds to HTTP(s) requests and runs cron.
The web server container has all you need enabled for development; you can specify custom configurations using the ./docker/webserver/templates/*
files.
In addition, the following directories are of interest:
The web root is available at
./www
Web server logs are available at
./docker/webserver/logs
LetsEncrypt certificates are available at
./docker/webserver/letsencrypt
SSL
Upon running make up
the web server container will generate a certificate for the configured $DOMAIN
, if one has already been generated it'll be reinstalled if it isn't already.
When working on localhost
a self-signed certificate will be used, for all other domains (as specified by the $DOMAIN
env var) both the naked domain and www
subdomain will have a Let's Encrypt certificate generated and installed.
Certificates will be renewed automatically by certbot
using root's crontab
; if you need to create or renew these manually then you are free to use the make ssl-create
and make ssl-renew
commands.
Trusting the localhost
self-signed certificate
localhost
self-signed certificateTo avoid "insecure website" errors and to show a padlock in your browser you can trust the certificate included in the Environment. This certificate is identical between all instances of the Docker environment so trusting it for one project will mean it is trusted for another.
How you do this depends on your OS:
Locate
./docker/webserver/ssl/localhost.crt
Open Keychain Access
Navigate to the
Certificates
section in the sidebarDrag the certifiate into Keychain Access
Double click the certificate
Under the
Trust
section, set it toAlways Trust
Close the window, you will be asked for your password
Your Mac will now trust this certificate when it is used 🎉
Securing additional domains
By default, certbot will check DNS for $DOMAIN
and www.$DOMAIN
and generate a single certificate for both. If you need to add additional domains to the certificate you can do so by specifying them as a comma separated list as the $SSL_ADDITIONAL_DOMAINS
env var.
Cron
There is an empty crontab which you can populate at ./docker/webserver/crontab
. This will populate in the web server when make up
is called. If needed, you can populate root's crontab using the template at ./docker/webserver/crontab-root
.
Last updated
Was this helpful?