我正试图创建一个包含pg
和pgadmin
的docker-compose
堆栈,如下所示:
version: '3.1'
services:
pg-admin:
image: dpage/pgadmin4
volumes:
- /Users/pkaramol/Desktop/backup.tar:/pgadmin4/dvdrental.tar
ports:
- "8181:80"
environment:
PGADMIN_DEFAULT_EMAIL: user@domain.com
PGADMIN_DEFAULT_PASSWORD: 1234
depends_on:
- pg
pg:
image: postgres:12
volumes:
- ./pg-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
restart: always
但是 pgadmin
的日志显示如下错误:
pg-admin_1 | Traceback (most recent call last):
pg-admin_1 | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1811, in full_dispatch_request
pg-admin_1 | rv = self.preprocess_request()
pg-admin_1 | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2087, in preprocess_request
pg-admin_1 | rv = func()
pg-admin_1 | File "/usr/local/lib/python3.8/site-packages/flask_wtf/csrf.py", line 224, in csrf_protect
pg-admin_1 | self.protect()
pg-admin_1 | File "/usr/local/lib/python3.8/site-packages/flask_wtf/csrf.py", line 259, in protect
pg-admin_1 | self._error_response(e.args[0])
pg-admin_1 | File "/usr/local/lib/python3.8/site-packages/flask_wtf/csrf.py", line 302, in _error_response
pg-admin_1 | raise CSRFError(reason)
pg-admin_1 | flask_wtf.csrf.CSRFError: 400 Bad Request: The CSRF session token is missing.
有什么建议吗?