mirror of
https://github.com/apache/superset.git
synced 2024-09-13 00:59:37 -04:00
02aa3c6395
- Improve Docker image - smaller - faster to build - deterministict dependencies (see #5958) - Rework process to simplify setting things up - updated documentation - less commands to type - no files to move and modify - optional loading of samples - Still working in standalone mode (without volumes for superset)
64 lines
2.0 KiB
Docker
64 lines
2.0 KiB
Docker
FROM python:3.6
|
|
|
|
RUN useradd --user-group --create-home --no-log-init --shell /bin/bash superset
|
|
|
|
# Configure environment
|
|
ENV LANG=C.UTF-8 \
|
|
LC_ALL=C.UTF-8
|
|
|
|
RUN apt-get update -y
|
|
|
|
# Install dependencies to fix `curl https support error` and `elaying package configuration warning`
|
|
RUN apt-get install -y apt-transport-https apt-utils
|
|
|
|
# Install superset dependencies
|
|
# https://superset.incubator.apache.org/installation.html#os-dependencies
|
|
RUN apt-get install -y build-essential libssl-dev \
|
|
libffi-dev python3-dev libsasl2-dev libldap2-dev libxi-dev
|
|
|
|
# Install extra useful tool for development
|
|
RUN apt-get install -y vim less postgresql-client redis-tools
|
|
|
|
# Install nodejs for custom build
|
|
# https://superset.incubator.apache.org/installation.html#making-your-own-build
|
|
# https://nodejs.org/en/download/package-manager/
|
|
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
|
|
&& apt-get install -y nodejs
|
|
|
|
# https://yarnpkg.com/lang/en/docs/install/#debian-stable
|
|
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
|
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
|
|
&& apt-get update \
|
|
&& apt-get install -y yarn
|
|
|
|
WORKDIR /home/superset
|
|
|
|
COPY requirements.txt .
|
|
COPY requirements-dev.txt .
|
|
|
|
RUN pip install --upgrade setuptools pip \
|
|
&& pip install -r requirements.txt -r requirements-dev.txt \
|
|
&& rm -rf /root/.cache/pip
|
|
|
|
USER superset
|
|
|
|
COPY --chown=superset:superset superset superset
|
|
|
|
ENV PATH=/home/superset/superset/bin:$PATH \
|
|
PYTHONPATH=/home/superset/superset/:$PYTHONPATH
|
|
|
|
RUN cd superset/assets \
|
|
&& yarn --non-interactive --frozen-lockfile --link-duplicates \
|
|
&& yarn run sync-backend \
|
|
&& yarn run build \
|
|
&& rm -rf node_modules \
|
|
&& yarn cache clean
|
|
|
|
COPY contrib/docker/docker-init.sh .
|
|
COPY contrib/docker/docker-entrypoint.sh /entrypoint.sh
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
HEALTHCHECK CMD ["curl", "-f", "http://localhost:8088/health"]
|
|
|
|
EXPOSE 8088
|