
bernieke/recipes这是一个Django应用,用于管理食谱和创建可发送至OurGroceries的购物清单。支持通过Docker(使用现有PostgreSQL数据库或内置SQLite数据库)或结合PostgreSQL和nginx的docker-compose完整栈进行部署。
!recipe
!index
!quantity
!shopping list
!admin
执行以下命令启动服务并创建超级用户:
bashdocker-compose up -d && \ docker exec -it recipes_recipes_1 /opt/recipes/manage.py createsuperuser
升级时,需保存Django的SECRET_KEY以避免现有会话失效:
bashdocker pull bernieke/recipes && \ DJANGO_SECRET_KEY="`docker exec recipes_recipes_1 cat /opt/recipes/secret.key`" docker-compose up -d && \ docker image prune -f
执行以下命令构建并启动开发容器:
bashdocker rm -vf recipes; \ docker image rm recipes; \ docker image prune -f; \ docker build . -t recipes --force-rm && \ docker create --name recipes -p 8000:8000 recipes && \ docker start recipes && \ docker logs recipes -f
注意:启用DEBUG时,食材不会实际发送至OurGroceries。
bashpip install -r requirements.txt GUNICORN=0 DEBUG=1 ./manage.py runserver
可通过为recipes容器添加前缀为GUNICORN_的环境变量来配置Gunicorn(例如GUNICORN_WORKERS将对应Gunicorn的WORKERS设置)。
可修改nginx.conf文件以更改nginx配置。
Docker镜像通过以下环境变量进行配置(已在docker-compose.yml中预设):
django.db.backends.sqlite3;使用PostgreSQL时设为django.db.backends.postgresql)/var/lib/recipes存在则为/var/lib/recipes/db.sqlite3,否则为./db.sqlite3)
manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务