Setup Your Application
Learn how to setup your application for deployment.
The andasy setup command streamlines the initial configuration of your application for deployment. When you run andasy setup, the CLI performs three key tasks:
- Detects your application stack - Analyzes your project directory to identify the programming language, framework, and dependencies
- Generates a Dockerfile - Creates a
Dockerfilethat defines how to build and run your application as a container - Creates a configuration file - Produces a
andasy.hclfile that specifies deployment settings like resources, ports, environment variables, and regions
These files are essential for deploying your application with Andasy, ensuring consistent environments and simplified deployment workflows.
Understanding the Generated Files
Dockerfile
A Dockerfile is a text file that contains instructions for building a container image of your application. Containers package your application code along with its dependencies and runtime environment, ensuring it runs consistently across different machines. The generated Dockerfile tells Andasy:
- What base image to use (e.g., Node.js, Python, Go)
- How to install dependencies
- How to build your application
- What command to run when the container starts
If you already have a Dockerfile in your project, andasy setup will detect and use it instead of generating a new one.
Configuration File (andasy.hcl)
The andasy.hcl file uses HCL (HashiCorp Configuration Language), a human-readable configuration format. This file defines:
- Your application name
- Resource allocation (CPU, memory)
- Network settings (ports)
- Environment variables
- Storage requirements (if needed)
This configuration file is what Andasy reads to understand how you want your application deployed. You can edit it manually to adjust settings without regenerating it.
Selecting a Region
After running andasy setup, open the generated andasy.hcl file and review the region settings:
- Set a primary region using the
primary_regionfield in theappblock. - Optionally, configure additional regions using the
regionslist for multi-region deployments.
Choosing the right region ensures your application runs close to your users and meets any data residency requirements you may have.
See the Regions guide for details on how to list available regions and decide which ones to use.
Customizing Setup
You can customize the setup process using various flags, such as specifying the application name, organization, or output format. The command is designed to be flexible, supporting both interactive and automated workflows.
Usage
andasy setup [flags]
Flags
--generate-nameGenerate an app name-h, --helphelp for setup--namestring The app name to use-o, --org string The target andasy organization