mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-13 09:54:10 +00:00
41 lines
1.4 KiB
Docker
41 lines
1.4 KiB
Docker
# Defining environment
|
|
ARG APP_ENV=prod
|
|
|
|
FROM python:3.8 as base
|
|
# ENV DOCKERIZE_VERSION v0.6.1
|
|
# RUN apk --no-cache add curl tar \
|
|
# && curl https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-runner/9.4.20.v20190813/jetty-runner-9.4.20.v20190813.jar --output jetty-runner.jar \
|
|
# && curl -L https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar -C /usr/local/bin -xzv
|
|
RUN apt-get update && apt-get install -y \
|
|
librdkafka-dev \
|
|
python3-ldap \
|
|
libldap2-dev \
|
|
libsasl2-dev \
|
|
ldap-utils \
|
|
&& python -m pip install --upgrade pip wheel setuptools
|
|
|
|
FROM openjdk:8 as prod-build
|
|
COPY . /datahub-src
|
|
# RUN cd /datahub-src && ./gradlew :metadata-events:mxe-schemas:build
|
|
|
|
FROM base as prod-codegen
|
|
COPY --from=prod-build /datahub-src /datahub-src
|
|
# RUN cd /datahub-src/metadata-ingestion && \
|
|
# pip install -e ".[base]" && \
|
|
# ./scripts/codegen.sh
|
|
|
|
FROM base as prod-install
|
|
COPY --from=prod-codegen /datahub-src/metadata-ingestion /datahub-ingestion
|
|
RUN cd /datahub-ingestion && \
|
|
pip install ".[all]"
|
|
|
|
FROM base as dev-install
|
|
# Dummy stage for development. Assumes code is built on your machine and mounted to this image.
|
|
# See this excellent thread https://github.com/docker/cli/issues/1134
|
|
|
|
FROM ${APP_ENV}-install as final
|
|
|
|
RUN addgroup --system datahub && adduser --system datahub --ingroup datahub
|
|
USER datahub
|
|
|
|
ENTRYPOINT [ "datahub" ] |