Subham9126 commited on
Commit
27c3627
·
verified ·
1 Parent(s): 55d6d7d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -0
Dockerfile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM apache/airflow:2.10.0-python3.11
2
+
3
+ # Port 7860 is required for HF Spaces
4
+ ENV AIRFLOW__WEBSERVER__WEB_SERVER_PORT=7860
5
+ ENV AIRFLOW__CORE__LOAD_EXAMPLES=False
6
+ ENV AIRFLOW_HOME=/opt/airflow
7
+
8
+ USER root
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ build-essential \
11
+ && apt-get clean \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ USER airflow
15
+
16
+ # Copy DAGs and requirements
17
+ COPY --chown=airflow:0 dags/ /opt/airflow/dags/
18
+ COPY requirements.txt .
19
+
20
+ RUN pip install --no-cache-dir -r requirements.txt
21
+
22
+ # Initialize DB, Create Admin User, and Start Services
23
+ # We use 'airflow db init' for local SQLite testing
24
+ ENTRYPOINT ["/usr/bin/bash", "-c"]
25
+ CMD ["airflow db init && \
26
+ airflow users create --username admin --password admin --firstname Jack --lastname Sparrow --role Admin --email admin@example.com && \
27
+ (airflow scheduler & airflow webserver)"]