-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
64 lines (54 loc) · 1.94 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM python:3.8-slim-buster
LABEL maintainer="Artur Kuchynski <arturkuchynski@gmail.com>" \
description="Dockerized Apache Airflow"
ENV DEBIAN_FRONTEND noninteractive
ENV TERM linux
ENV LANGUAGE=C.UTF-8 LANG=C.UTF-8 LC_ALL=C.UTF-8 \
LC_CTYPE=C.UTF-8 LC_MESSAGES=C.UTF-8
ENV GUNICORN_CMD_ARGS --log-level WARNING
# Logs will be thrown directly to the I/O stream
ENV PYTHONUNBUFFERED 1
ARG AIRFLOW_HOME=/usr/local/airflow
ENV AIRFLOW_HOME=${AIRFLOW_HOME}
ARG AIRFLOW_VERSION=2.0.0
ARG AIRFLOW_DATA_PATH=/usr/local/airflow_data
RUN apt-get update -qq \
&& apt-get upgrade -yqq \
&& apt-get install -yqq --no-install-recommends \
build-essential \
default-libmysqlclient-dev \
apt-utils \
curl \
rsync \
netcat \
locales \
git \
wget \
libsm6 \
libxrender1 \
libpq-dev \
libsasl2-dev \
libssl-dev \
libffi-dev \
libkrb5-dev \
&& useradd --shell /bin/bash --create-home --home ${AIRFLOW_HOME} airflow \
&& pip install -U pip setuptools wheel \
&& pip install ndg-httpsclient pytz pyOpenSSL pyasn1 typing-extensions ipython psycopg2-binary \
&& pip install apache-airflow[async,aws,crypto,mysql,postgres,password,ssh,celery]==${AIRFLOW_VERSION} \
&& apt-get autoremove -yqq --purge \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/var/tmp/* \
/tmp/*
COPY requirements.txt ${AIRFLOW_HOME}/requirements.txt
COPY entrypoint.sh ${AIRFLOW_HOME}/entrypoint.sh
COPY airflow.cfg ${AIRFLOW_HOME}/airflow.cfg
RUN pip install --no-cache-dir -r ${AIRFLOW_HOME}/requirements.txt
RUN mkdir -p ${AIRFLOW_HOME}/logs && mkdir -p ${AIRFLOW_HOME}/dags && mkdir -p ${AIRFLOW_DATA_PATH}
RUN chown -R airflow: ${AIRFLOW_HOME} && chown -R airflow: ${AIRFLOW_DATA_PATH}
RUN chmod +x ${AIRFLOW_HOME}/entrypoint.sh
WORKDIR ${AIRFLOW_HOME}
EXPOSE 8080 5555 8793
ENTRYPOINT ["./entrypoint.sh"]
CMD ["webserver"]