Toystack Docs
  • What is ToyStack?
  • Pricing
  • Get Started
    • Installing ToyStack
      • Github Installation
      • BitBucket Installation
    • Custom Domains and External Domains
    • Databases
  • Virtual OS
    • Getting Started
    • Claude Integration
  • Backend Quickstarts
    • Node JS
    • Django
    • Flask
    • Go
    • Java
    • PHP
  • Frontend Quickstarts
    • ReactJS
    • AstroJs
    • VueJs
    • Solara
Powered by GitBook
On this page
  • Step 1: Ensure your app is Dockerised
  • Step 2: Import your Git repository
  • Step 3: Input environment variables
  • Step 4: Choose a plan
  • Step 5: Deploy
  1. Backend Quickstarts

Go

Instructions for connecting your Go apps and deploying them on ToyStack

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:

# 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

Step 3: Input environment variables

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

Step 4: Choose a plan

Step 5: Deploy

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

PreviousFlaskNextJava

Last updated 6 months ago

Go to the and create a new project using your repository.

For detailed instructions, please see the page.

ToyStack Dashboard
Environment Variables