To enable the new CORS support you will need to add the access_control_allow_origin
setting to your docker-compose.yml file (or similar) before launching the container. We recommend launching the container through Docker Compose or a suitable container orchestration system which is able to handle such values.
Providing multi-line environment variables through the docker run command is often problematic in our experience. You can find a sample Docker Compose file on our public GitHub repository here.
A complete docker-compose.yml file which incorporates the above setting may look like:
version: '3.5'
services:
apish:
image: draftable/apish
environment:
DRAFTABLE_APISH_NGINX: |-
nginx:
virtual_hosts:
draftable:
conf_settings:
access_control_allow_origin: desired-domain.tld
ports:
- 80:80/tcp # HTTP
- 443:443/tcp # HTTPS
volumes:
- draftable-apish:/srv/draftable
- /sys/fs/cgroup:/sys/fs/cgroup
volumes:
draftable-apish:
Once set, you'll see the relevant Access-Control-* headers be returned in requests to the container.