GitHub user ajyadav013 added a comment to the discussion: How to rebuild assets
on top of superset image?
This is a working Dockerfile
FROM apache/superset:4.1.1
# Switch to root to install build dependencies
USER root
ENV PYTHONPATH="/srv/superset:${PYTHONPATH}"
# Install required build tools
RUN apt-get update && \
apt-get install -y gcc build-essential libpq-dev libaio-dev liblz4-dev
ca-certificates && \
rm -rf /var/lib/apt/lists/*
WORKDIR /srv/superset
# Copy only the requirements file first for caching benefits
COPY requirements/requirements.txt .
# Upgrade pip and install Python dependencies
RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
COPY . .
# Create a directory for the custom configuration file within the working
directory
RUN mkdir -p /srv/superset/config
COPY assets/ /app/superset/static/assets
# Copy your custom Superset configuration file to /srv/superset/config
COPY superset_config/config.py /srv/superset/config/config.py
RUN chown superset:superset /srv/superset/config/config.py
# Copy your custom initialization script and make it executable
COPY superset_config/superset_init.sh /usr/local/bin/superset_init.sh
RUN chmod +x /usr/local/bin/superset_init.sh
ENV SUPERSET_CONFIG_PATH=/srv/superset/config/config.py
# Set environment variables for Superset and the initialization script.
# Note: SUPERSET_CONFIG_PATH now points to the config file in the working
directory.
# Expose the default Superset port.
EXPOSE 80
#ENTRYPOINT ["python", "entrypoint.py"]
# Set the custom initialization script as the container's startup command.
#CMD ["/usr/local/bin/superset_init.sh"]
ENTRYPOINT ["python", "entrypoint.py"]
GitHub link:
https://github.com/apache/superset/discussions/31640#discussioncomment-12846163
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]