Skip to content

Commit 245d82e

Browse files
committed
adding two dbs
1 parent 554b6ea commit 245d82e

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ ADMINER_PORT=8081
1515
# Prefect
1616
PREFECT_TAG=2.13.2-python3.10
1717
PREFECT_PORT=4200
18+
PREFECT_DB_PORT=5433
1819
PREFECT_UI_URL=http://127.0.0.1:4200/api
1920
PREFECT_SERVER_API_URL=http://127.0.0.1:4200/api
20-
PREFECT_API_DATABASE_CONNECTION_URL=postgresql+asyncpg://${DB_USER}:${DB_PASSWORD}@postgres:5432/${DB_NAME}
21+
PREFECT_API_DATABASE_CONNECTION_URL=postgresql+asyncpg://${DB_USER}:${DB_PASSWORD}@prefect-postgres:5432/prefect
2122
PREFECT_API_URL=http://prefect-server:4200/api
2223

2324
# MLFlow

docker-compose.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ services:
4444
PREFECT_SERVER_API_HOST: 0.0.0.0
4545
PREFECT_API_DATABASE_CONNECTION_URL: $PREFECT_API_DATABASE_CONNECTION_URL
4646
depends_on:
47-
- postgres
47+
- prefect-postgres
4848
ports:
4949
- ${PREFECT_PORT}:4200
5050
volumes:
@@ -101,6 +101,22 @@ services:
101101
[[ ! -z "`/usr/bin/mc ls s3 | grep challenge`" ]] || /usr/bin/mc mb s3/prefect-flows; /usr/bin/mc policy download s3/prefect-flows;
102102
[[ ! -z "`/usr/bin/mc ls s3 | grep challenge`" ]] || /usr/bin/mc mb s3/data; /usr/bin/mc policy download s3/data; exit 0; '
103103
104+
prefect-postgres:
105+
image: postgres:${POSTGRES_TAG}
106+
container_name: ${PROJECT_NAME}-prefect-postgres
107+
hostname: prefect-postgres
108+
restart: unless-stopped
109+
stop_grace_period: 10s
110+
env_file: .env
111+
environment:
112+
POSTGRES_PASSWORD: $DB_PASSWORD
113+
POSTGRES_DB: prefect
114+
POSTGRES_USER: $DB_USER
115+
ports:
116+
- ${PREFECT_DB_PORT}:5432
117+
volumes:
118+
- prefect-postgres-data:/var/lib/postgresql/data
119+
104120
postgres:
105121
image: postgres:${POSTGRES_TAG}
106122
container_name: ${PROJECT_NAME}-postgres
@@ -149,6 +165,7 @@ networks:
149165
volumes:
150166
prefect-data: {}
151167
postgres-data: {}
168+
prefect-postgres-data: {}
152169
minio-data: {}
153170
portainer-data: {}
154171

0 commit comments

Comments
 (0)