Skip to content

Test & deploy

Test

We can test locally the final rendering of your dashboard simply by setting design=False in the Gui class:

gui.run(design=False)

Deploy

Taipy Designer applications are particular cases of Taipy applications, and their deployment follows Taipy applications deployment guidelines.

You deployment scripts have to take into account that Taipy Designer setup must use the provided tar.gz installer. To illustrate this, assume your application to be deployed is under an app directory:

app/
├─ requirements.txt
├─ main.py
├─ main.xprjson

Add Taipy Designer tar.gz package, as well as this Docker file to this directory:

# Your Python version
FROM python:3.9 as taipy

# Web port of the application
EXPOSE 5000

# Create taipy user for security
RUN groupadd -r taipy && useradd -r -m -g taipy taipy
USER taipy

# Go to the dedicated folder and add the python corresponding folder in PATH
WORKDIR /home/taipy
ENV PATH="${PATH}:/home/taipy/.local/bin"

# Copy Taipy Designer tar.gz and your app files
COPY . /home/taipy/

# Update pip
RUN python -m pip install --upgrade pip

# Install Taipy Designer tar.gz
RUN python -m pip install taipy-designer-<version>.tar.gz

# Install application's dependencies
RUN python -m pip install -r requirements.txt

# Start up command
ENTRYPOINT [ "python", "main.py", "--port", "5000", "--host", "0.0.0.0", "--no-reloader" ]

Your directory structure should look like:

app/
├─ requirements.txt
├─ main.py
├─ main.xprjson
├─ taipy-designer-1.0.tar.gz
├─ Dockerfile

Don't forget to set design=False for the gui as in Test section.

To build the Docker image, use:

docker build . -t taipyapp

To run it:

docker run -p 5000:5000 taipyapp

Authentication and authorization

Similar to deployment, authentication and authorization are supported feature of Taipy Enterprise. Please follow these guidelines for detailed information.