Skip to content

Commit

Permalink
Start local database
Browse files Browse the repository at this point in the history
  • Loading branch information
dyakovri committed Aug 30, 2023
1 parent 63fc3ce commit fb71059
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: '3.8'
services:
airflow:
image: ghcr.io/profcomff/dwh-airflow:test
# build: .
depends_on:
- postgres
pull_policy: always
Expand All @@ -11,7 +12,7 @@ services:
restart: on-failure:5
environment:
- AIRFLOW_ENV=DEV
- AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://postgres@postgres:5432/postgres
- AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:airflow@postgres:5432/airflow
volumes:
- ./pipelines:/airflow/dags/dwh-pipelines
- ./start_local.sh:/start_inc.sh
Expand All @@ -21,5 +22,10 @@ services:
restart: always
environment:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_USER: airflow
POSTGRES_PASSWORD: airflow
POSTGRES_DB: airflow
ports:
- 5432:5432
volumes:
- ./start_local.sql:/docker-entrypoint-initdb.d/start_inc.sql
2 changes: 1 addition & 1 deletion pipelines
2 changes: 1 addition & 1 deletion start_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ airflow users create --username admin --password admin --firstname Local --lastn

# Создаем локальное подключение к БД
airflow connections add \
--conn-uri postgresql://postgres@postgres:5432/postgres \
--conn-uri postgresql://postgres:postgres@postgres:5432/dwh \
--conn-description "Основное подключение к БД DWH" \
posrgres_dwh

Expand Down
2 changes: 2 additions & 0 deletions start_local.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE USER postgres WITH PASSWORD 'postgres';
CREATE DATABASE postgres WITH OWNER postgres;

0 comments on commit fb71059

Please sign in to comment.