Skip to content

Commit

Permalink
Merge pull request #90 from cr34t1ve/add-fly-experiment
Browse files Browse the repository at this point in the history
feat: add fly.io experiment
  • Loading branch information
mychidarko committed Mar 5, 2024
2 parents 884c10f + 98765c8 commit fcb1243
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 4 deletions.
58 changes: 58 additions & 0 deletions src/codelabs/experiments/deployment/fly.io/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Deploying a LeafMVC Application to Fly.io

::: warning Version support
Version support. This tutorial assumes use of LeafPHP >= 3.0 and PHP >=7.0.
:::

## What Are We Building

This experiment will guide you deploying your first LeafMVC / base Leaf application to Fly.io. A majority
of the same steps apply to Leaf v3 core as well. This guide uses docker to deploy your application.
You do not need to have docker installed on your local machine to follow this guide. Neither do you
need to have prior knowledge of docker.

::: details (New to Fly.io?)
Fly.io transforms containers into micro-VMs that run on their hardware.
:::

## Prerequisites

This tutorial assumes you have the following:

- A Leaf application
- A Fly.io account
- The [flyctl cli tool](https://fly.io/docs/hands-on/install-flyctl/) installed

## 1. Set up docker in your Leaf application

You can clone the [Fly.io starter template](https://github.com/cr34t1ve/leaf-fly-io-template) to get started.

```bash
git clone https://github.com/cr34t1ve/leaf-fly-io-template.git
```

This template has a `Dockerfile` and a `fly.toml` file already set up for you.

## 2. Deploy your application

Navigate to your application's root directory and run the following command:

```bash
fly deploy
```

This command will build your docker image and deploy it to Fly.io.

After setting up your application, you can then run the following to launch your application:

```bash
fly launch
```

You can then visit your application at the URL provided.

## Conclusion

You have successfully deployed your LeafMVC application to Fly.io. You can now scale your application

Experiment by **[Desmond Sofua](https://github.com/cr34t1ve)**
9 changes: 5 additions & 4 deletions src/codelabs/experiments/deployment/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

This is a collection of codelab experiments related to deployment across different platforms.

| Provider | Description |
| :-------------------------------------------------------------- | :----------------------------------------------------------------- |
| [Digital Ocean](/codelabs/experiments/deployment/digitalocean/) | Deploying LeafMVC projects to a new Digital Ocean droplet |
| [Heroku](/codelabs/experiments/deployment/heroku/) | Deploying a base Leaf project to Heroku using the Leaf CLI |
| Provider | Description |
| :-------------------------------------------------------------- | :--------------------------------------------------------- |
| [Digital Ocean](/codelabs/experiments/deployment/digitalocean/) | Deploying LeafMVC projects to a new Digital Ocean droplet |
| [Heroku](/codelabs/experiments/deployment/heroku/) | Deploying a base Leaf project to Heroku using the Leaf CLI |
| [Fly.io](/codelabs/experiments/deployment/fly.io/) | Deploying a base Leaf application to Fly.io |

0 comments on commit fcb1243

Please sign in to comment.