I created a docker machine on EC2.
Then I created a new cookiecutter-django app and left it plain vanilla. It's set to use .env for the environment variables. (Cookiecutter-django includes django-environ for accessing environment variables.)
docker-compose -f production.yml build
worked fine.
docker-compose -f production.yml up
gives this error:
django_1 | botocore.exceptions.ParamValidationError: Parameter validation failed:
django_1 | Invalid bucket name "": Bucket name must match the regex "^[a-zA-Z0-9.\-_]{1,255}$"
Researching this error, the advise was setting various environment variables. So I've tried them all in the .env (I did create an s3 bucket named pulsemanager):
DJANGO_AWS_STORAGE_BUCKET_NAME=pulsemanager
AWS_S3_BUCKET_NAME_STATIC=pulsemanager
AWS_STORAGE_BUCKET_NAME=pulsemanager
No matter what I try I'm stuck with the error.
EDIT: It's not exactly plain vanilla. By default cookiecutter-django is using the Caddy http server instead of nginx in docker. That includes SSL and won't work behind an AWS load balancer with an AWS certificate manager SSL. So I did change the default production.yml to bring in nginx instead of Caddy, following this article.