Skip to content

For production


Production ready Dockerfile

The following Dockerfile contains the minimum configuration settings to deploy your application to production.

This template assumes that you provide a requirements.txt file with all the Python dependencies of your application and that your application entry point is the file

# Your Python version
FROM python:3.9 as taipy

# Web port of the application

# 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"

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

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

# Install your application
COPY . .

# Start up command
ENTRYPOINT [ "python", "", "-P", "5000", "-H", "", "--no-reloader" ]


If you are using a SQL database based on Microsoft SQL Server, you need to add the following commands before creating the user:

RUN apt-get update && apt-get install -y lsb-release && apt-get clean all
RUN curl | apt-key add -
RUN curl$(lsb_release -rs)/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt update && ACCEPT_EULA=Y apt install -y msodbcsql18 unixodbc-dev

Production ready Docker Compose

Exposing your application directly to the Internet is not recommended. Letting Nginx handle the responsibility is better for security and reliability. Consequently, besides your docker-compose.yaml, create a file named nginx.conf with the following content.

Then, update your docker-compose.yaml:

version: "3.9"
    build: ""
    image: nginx:1.25
       - "5000:80"
      - ./nginx.conf:/etc/nginx/nginx.conf