> For the complete documentation index, see [llms.txt](https://docs.toystack.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toystack.ai/backend-quickstarts/flask.md).

# Flask

## Step 1: Ensure your app is Dockerised

ToyStack uses docker to deploy your application and will look for a `Dockerfile` in the top-level of your project structure.

You can either use your own `Dockerfile` or use the following template:

```docker
FROM python:3.8

ENV PYTHONUNBUFFERED 1
RUN mkdir /workdir
WORKDIR /workdir
COPY requirements.txt /workdir/
RUN pip install --upgrade pip wheel
RUN pip install -r requirements.txt
COPY . /workdir/

CMD ["python", "-m", "flask", "run", "--host=0.0.0.0", "--port=5000"]
```

## Step 2: Import your Git repository

Go to the [ToyStack Dashboard](https://dashboard.toystack.ai) and create a new project using your repository.

## Step 3: Input environment variables

{% hint style="info" %}
Please ensure the `Framework Preset` is set to `DOCKER`. The rest of the variables can be set as required for your project.

Also ensure the `PORT` number matches the one specified in your `Dockerfile`
{% endhint %}

For detailed instructions, please see the [Environment Variables](/get-started/environment-variables-setup.md) page.

## Step 4: Choose a plan

<figure><img src="/files/cWa6RjkgngmQFzPFFWRv" alt=""><figcaption></figcaption></figure>

## Step 5: Deploy

Simply select the branch you want to deploy, its deployment validity and ToyStack will deploy it
