> 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/go.md).

# Go

## 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
# Use the official Golang image as a base image
FROM golang:latest

# Set the working directory inside the container
WORKDIR /go/src/app

# Copy the local package files to the container's workspace
COPY . .

# Build the Go application
RUN go build -o app .

# Expose port 8080 to the outside world
EXPOSE 8080

# Command to run the executable
CMD ["./app"]
```

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.toystack.ai/backend-quickstarts/go.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
