Replies: 2 comments 2 replies
-
If your PostgreSQL server is launched through the Docker Compose configuration, it'll probably be accessible through its internal hostname, not So you should probably set the following in your postgres: # This is the internal Docker host for this container
image: postgres:alpine
environment:
- POSTGRES_PASSWORD=fief # This will be the database password, DATABASE_PASSWORD
- POSTGRES_USER=fief # This will be the database user, DATABASE_USERNAME
- POSTGRES_DB=fief # This will be the database name, DATABASE_NAME
volumes:
- postgres-data:/var/lib/postgresql/data DATABASE_TYPE=POSTGRESQL
DATABASE_HOST=postgres
DATABASE_PORT=5432
DATABASE_USERNAME=fief
DATABASE_PASSWORD=fief
DATABASE_NAME=fief |
Beta Was this translation helpful? Give feedback.
-
Hello, @frankie567 👋 I've noticed you shared secret values: For your security, I've taken the liberty to replace them with dummy values. |
Beta Was this translation helpful? Give feedback.
-
Am trying to follow the setup from this link https://docs.fief.dev/self-hosting/deployment/docker-compose/ and https://docs.fief.dev/self-hosting/deployment/setup-database/
Created a docker compose file and env file and this is the error am getting
fief-server_1 | │ │
fief-server_1 | │ ╭───────────────────────────────── locals ─────────────────────────────────╮ │
fief-server_1 | │ │ connection_factory = None │ │
fief-server_1 | │ │ cursor_factory = None │ │
fief-server_1 | │ │ dsn = 'host=localhost user=postgres password=47574757 │ │
fief-server_1 | │ │ port=5432 dbname=postgres' │ │
fief-server_1 | │ │ kwargs = { │ │
fief-server_1 | │ │ │ 'host': 'localhost', │ │
fief-server_1 | │ │ │ 'database': 'postgres', │ │
fief-server_1 | │ │ │ 'user': 'postgres', │ │
fief-server_1 | │ │ │ 'password': '47574757', │ │
fief-server_1 | │ │ │ 'port': 5432 │ │
fief-server_1 | │ │ } │ │
fief-server_1 | │ │ kwasync = {} │ │
fief-server_1 | │ ╰──────────────────────────────────────────────────────────────────────────╯ │
fief-server_1 | ╰──────────────────────────────────────────────────────────────────────────────╯
fief-server_1 | OperationalError: (psycopg2.OperationalError) could not connect to server:
fief-server_1 | Connection refused
fief-server_1 | Is the server running on host "localhost" (127.0.0.1) and accepting
fief-server_1 | TCP/IP connections on port 5432?
fief-server_1 | could not connect to server: Cannot assign requested address
fief-server_1 | Is the server running on host "localhost" (::1) and accepting
fief-server_1 | TCP/IP connections on port 5432?
fief-server_1 |
fief-server_1 | (Background on this error at: https://sqlalche.me/e/14/e3q8)
pythonproject4_fief-server_1 exited with code 1
these are the parameters
(docker-compose)
version: "3"
services:
fief-server:
image: ghcr.io/fief-dev/fief:latest
command: fief run-server --port 80
expose:
- 80
env_file:
- .env
fief-worker:
image: ghcr.io/fief-dev/fief:latest
command: fief run-worker -p 1 -t 1
env_file:
- .env
postgres:
image: postgres:alpine
environment:
- POSTGRES_PASSWORD=fief
- POSTGRES_USER=fief
- POSTGRES_DB=fief
volumes:
- postgres-data:/var/lib/postgresql/data
redis:
image: redis:alpine
command: redis-server --save 60 1 --loglevel warning
volumes:
- redis-data:/data
volumes:
redis-data:
postgres-data:
SECRET=XXX-4cuss2puIz4Tp4oWW9Ug
FIEF_CLIENT_ID=XXX-lE
FIEF_CLIENT_SECRET=XXX
ENCRYPTION_KEY=XXX=
PORT=8000
ROOT_DOMAIN=127.0.0.1:8000
FIEF_DOMAIN=127.0.0.1:8000
FIEF_MAIN_USER_EMAIL=[email protected]
FIEF_MAIN_USER_PASSWORD=47574757
CSRF_COOKIE_SECURE=False
LOGIN_SESSION_COOKIE_SECURE=False
SESSION_COOKIE_SECURE=False
FIEF_ADMIN_SESSION_COOKIE_SECURE=False
Read more: https://docs.fief.dev/self-hosting/deployment/setup-database/
DATABASE_TYPE=POSTGRESQL
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USERNAME=postgres
DATABASE_PASSWORD=47574757
DATABASE_NAME=postgres
REDIS_URL=redis://redis:6379
Beta Was this translation helpful? Give feedback.
All reactions