docker-compose.yml
version: "3"
services:
sqlite3:
image: nouchka/sqlite3:latest
stdin_open: true
tty: true
volumes:
- ./db/:/root/db/
app:
build:
context: ../
dockerfile: build/Dockerfile
ports:
- "5000:5000"
volumes:
- ../:/app
command: pipenv run gunicorn --bind=0.0.0.0:5000 --reload app:app
现在,我如何让我的Flask应用程序连接到我的停靠数据库
SQLALCHEMY_DATABASE_URI = 'sqlite:///db.sqlite'
(我不确定在这里放什么来连接Docker映像数据库)
您可以在容器之间共享卷
现在
./db/
目录中的文件也可以从python映像访问,因此您可以如下设置URI:相关问题 更多 >
编程相关推荐