Skip to content

My Cookie Cutter. Docker, NGINX, FastAPI/Django, and more...

License

Notifications You must be signed in to change notification settings

rileypeterson/mycc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Cookie Cutter

Starting place for a stack which includes Docker, NGINX, Django/FastAPI, and more...

Usage

For main branch (otherwise tack on: --checkout <branch_name>):

cookiecutter https://github.com/rileypeterson/mycc.git
# Enter in Parameters
cd <project_slug>
source aliases.sh
deploy

Future Thoughts

Requirements

  • Docker

Favicon generator

https://favicon.io/

Environment Files

  • Environment files are placed here:
    {{cookiecutter.project_slug}}/config/.dev.env
    {{cookiecutter.project_slug}}/config/.prod.env
    
  • They're ignored
  • If they already exist, they won't be overwritten when generating the cookiecutter
    • This is because Postgres auth won't work if the credentials are overwritten
  • See aliases.sh (Doesn't remove these files)

Handling Unrendered Files

  • The following files aren't rendered and django templates don't play nicely with cookiecutter:
      "_copy_without_render": [
        "{{cookiecutter.project_slug}}/pages/templates/pages/*.html"
      ]
    
  • Therefore, just use the following [[[[cookiecutter.project_name]]]] (no spaces) within those files
  • It'll be rendered by the post_gen_project.py hook
  • For now only cookiecutter.project_name will be recognized, but it would be straight forward to add more.

Docker removal (caution, this is just for testing)

prod-down
docker volume rm $(docker volume ls -q)
docker system prune -a --volumes
rm -rf <project_slug>
rm -rf .cookiecutter*

Note

You can have an NGINX config which blocks IPs like this:

    location / {
        proxy_pass         http://django;
        include ddns/allowed_ips.conf;
        deny all;
    }

and the certbot ssl exchange will still work. Thus, you don't need to leave the root domain exposed to 80/443.

About

My Cookie Cutter. Docker, NGINX, FastAPI/Django, and more...

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published