anchor.diff:          libssl-dev && \
       apt-get clean && \
       tar xzf superset.tar.gz && \
  -    pip install Cython==0.29.21 pystan==2.19.1.1 && \
  +    pip install Cython==0.29.23 pystan==2.19.1.1 && \
       pip install dist/*.tar.gz -r requirements.txt && \
  -    rm -rf ./*
  +    rm -rf /tmp/superset
   
   # Configure Filesystem
   COPY bin /usr/local/bin
   WORKDIR /home/superset
  -VOLUME /etc/superset \
  -       /home/superset \
  -       /var/lib/superset
  +VOLUME /etc/superset
  +VOLUME /home/superset
  +VOLUME /var/lib/superset
   
   # Finalize application
   EXPOSE 8088
  
positive.code: # --- Install dist package and finalize app
  #
  
  FROM python:${PYTHON_VERSION} AS final
  
  # Configure environment
  # superset recommended defaults: https://superset.apache.org/docs/installation/configuring-superset#running-on-a-wsgi-http-server
  # gunicorn recommended defaults: https://docs.gunicorn.org/en/0.17.2/configure.html#security
  ENV GUNICORN_BIND=0.0.0.0:8088 \
      GUNICORN_LIMIT_REQUEST_FIELD_SIZE=8190 \
      GUNICORN_LIMIT_REQUEST_LINE=4094 \
      GUNICORN_THREADS=4 \
      GUNICORN_TIMEOUT=120 \
      GUNICORN_WORKERS=10 \
      GUNICORN_WORKER_CLASS=gevent \
      LANG=C.UTF-8 \
      LC_ALL=C.UTF-8 \
      PYTHONPATH=/etc/superset:/home/superset:$PYTHONPATH \
      SUPERSET_REPO=apache/superset \
      SUPERSET_VERSION=${SUPERSET_VERSION} \
      SUPERSET_HOME=/var/lib/superset
  ENV GUNICORN_CMD_ARGS="--bind ${GUNICORN_BIND} --limit-request-field_size ${GUNICORN_LIMIT_REQUEST_FIELD_SIZE} --limit-request-line ${GUNICORN_LIMIT_REQUEST_LINE} --threads ${GUNICORN_THREADS} --timeout ${GUNICORN_TIMEOUT} --workers ${GUNICORN_WORKERS} --worker-class ${GUNICORN_WORKER_CLASS}"
  
  # Create superset user & install dependencies
  WORKDIR /tmp/superset
  
negative.code: # --- Build assets with NodeJS
  #
  
  FROM node:$NODE_VERSION AS build
  
  # Superset version to build
  ARG SUPERSET_VERSION=master
  ENV SUPERSET_HOME=/var/lib/superset
  
  # Download source
  WORKDIR $SUPERSET_HOME
  RUN wget -qO /tmp/superset.tar.gz https://github.com/apache/superset/archive/$SUPERSET_VERSION.tar.gz
  RUN tar xzf /tmp/superset.tar.gz -C $SUPERSET_HOME --strip-components=1
  
  # Build assets
  WORKDIR $SUPERSET_HOME/superset-frontend/
  RUN npm install 2> /dev/null
  RUN npm run build 2> /dev/null
  
  #
  # --- Build dist package with Python 3
  #
  
  FROM python:$PYTHON_VERSION AS dist
  
  # Copy prebuilt workspace into stage
  ENV SUPERSET_HOME=/var/lib/superset
  WORKDIR $SUPERSET_HOME
  COPY --from=build $SUPERSET_HOME .
  COPY requirements.txt .
  
  # Create package to install
  