A complete docker-compose.yml
This article outlines all the configurable parameters that can be made within the docker compose YAML file. See below an example of a docker-compose file that has every possible configurable parameter.All docker-compose YAML parameters
Below is an explanation of each important field that can be configured to enable/disable certain features within the instance. You can also view the documentation on docker-composer created by docker.Default docker-compose parameters
These are parameters that are required for APISH but are configurable.Draftable Self-hosted specific environmental configuration settings
All fields underenvironment are additional features that have been added to the API Self-hosted product and can be customised here. There are two subfields,DRAFTABLE_APISH_NGINX: |- and DRAFTABLE_APISH_DJANGO: |-, NGINX is used for the majority of settings, whilst DJANGO is only used for CORS specific configurations. Ensure you place the correct setting variable under the right subfield. Refer to the full yaml example shown earlier.
Below are descriptions for all the different fields that can be added and hence configured.
use_x_forwarded_proto, and ensure the use_x_forwarded_proto header is being set by upstream load balancers and reverse proxies.
For more information you can view our SSL termination instructions article.
use_x_forwarded_proto header in requests to determine the URI scheme (HTTP or HTTPS). The header will be passed through to the frontend server, and used to check if a HTTP redirect to the equivalent HTTPS URL should be sent when HTTPS request redirection is enabled.
For more information you can view our SSL termination instructions article.
django: key sets whether CORS is enabled or not on the instance. If set to true CORS will be enabled on that instance.
For more information you can view our CORs implementation setup article.
cors: key allows you to provide a list of the allowed origins for CORS. The correct formatting for this field is shown above.
cors: key allows you to list the regular expressions matching the allowed origins.
cors: key allows you to turn on CORS requests from any origin. This is the equivalent of using * as a wildcard and needs to be set to True for this effect.
use_x_forwarded_proto
real_ip_header_name has been set, specifies an array of IPv4 and IPv6 addresses trusted to provide real IP address information. If untrusted clients can access the server and set this header, they can effectively “spoof” their IP address. It’s strongly recommended this setting be set to addresses of load balancers and reverse proxies forwarding requests.
- certificate:
- This notates which certificate is being used within the volume for ssl configuration. Note the value apish.crt in the YMAL example is just a placeholder name.
- private_key:
- This notates which private key is being used within the volume for ssl configuration. Note the value apish.key in the YAML example is just a placeholder name.