Skip to content

Commit 227bf45

Browse files
committed
feature: add db migration entrypoint
1 parent 338754f commit 227bf45

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,9 @@ RUN pip install --no-cache-dir -r requirements.txt
77

88
COPY ./dags ${AIRFLOW_HOME}/dags
99

10+
COPY entrypoint.sh /entrypoint.sh
11+
RUN chmod +x /entrypoint.sh
12+
13+
ENTRYPOINT ["/entrypoint.sh"]
14+
1015
USER ${AIRFLOW_UID}

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ services:
22
airflow-webserver:
33
image: ${DOCKER_HUB_USERNAME}/lp-airflow-crawler:latest
44
container_name: airflow-webserver
5-
command: webserver
5+
command: api-server
66
environment:
77
AIRFLOW__CORE__EXECUTOR: LocalExecutor
88
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: sqlite:////opt/airflow/airflow.db

entrypoint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# DB 초기화
2+
airflow db migrate
3+
4+
# 넘어온 명령어 실행
5+
exec airflow "$@"

0 commit comments

Comments
 (0)