-
Notifications
You must be signed in to change notification settings - Fork 21
/
flowetl.Dockerfile
52 lines (38 loc) · 1.5 KB
/
flowetl.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
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# FLOWETL
# -----
FROM apache/airflow:2.9.3-python3.10@sha256:1f395499be0fbc834e0a8a634754715a3938b08ca161b11cf9c837e4372aa9d2
ENV AIRFLOW__CORE__DAGS_FOLDER ${AIRFLOW_HOME}/dags
ENV AIRFLOW__CORE__LOAD_EXAMPLES False
# Turn off api access
ENV AIRFLOW__API__AUTH_BACKENDS=airflow.api.auth.backend.session
ENV AIRFLOW__WEBSERVER__RBAC=True
# Needed for custom users passed through docker's --user argument, otherwise it's /
ENV HOME ${AIRFLOW_USER_HOME_DIR}
# Install FlowETL module
ARG SOURCE_VERSION=0+unknown
ENV SOURCE_VERSION=${SOURCE_VERSION}
ENV SOURCE_TREE=FlowKit-${SOURCE_VERSION}
WORKDIR /${SOURCE_TREE}/flowetl
COPY --chown=airflow . /${SOURCE_TREE}/
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends libpq-dev build-essential && \
sudo -u airflow -s pip install --no-deps --no-cache-dir --ignore-installed -r requirements.txt && \
apt-get -y remove build-essential && \
apt purge -y --auto-remove && \
rm -rf /var/lib/apt/lists/*
USER airflow
RUN cd flowetl && pip install --no-deps --no-cache-dir .
WORKDIR ${AIRFLOW_HOME}
COPY ./flowetl/entrypoint.sh /flowetl_entry.sh
COPY ./flowetl/init.sh /init.sh
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/flowetl_entry.sh"]
# set default arg for entrypoint
EXPOSE 80
EXPOSE 8080
ENV FLOWETL_PORT=8080
CMD ["webserver"]