📖 Scenario: You have built a Remix web app and want to make it available on the internet. Fly.io is a platform that lets you deploy apps easily close to your users worldwide.In this project, you will prepare your Remix app for deployment, configure Fly.io settings, and deploy your app step-by-step.
🎯 Goal: By the end, you will have a Remix app deployed on Fly.io, accessible via a public URL.
📋 What You'll Learn
Create a fly.toml configuration file with app name and build settings
Add a Dockerfile to containerize the Remix app
Initialize Fly.io app with flyctl launch --no-deploy
Deploy the app using flyctl deploy
💡 Why This Matters
🌍 Real World
Deploying web apps to cloud platforms like Fly.io makes your app accessible worldwide with minimal setup.
💼 Career
Knowing how to deploy Remix apps to platforms like Fly.io is valuable for frontend and full-stack developers working on modern web projects.
Progress0 / 4 steps
1
Create the Fly.io configuration file
Create a file named fly.toml in your project root with these exact contents:
[app]
name = "my-remix-app"
[build]
builder = "heroku/buildpacks:20"
Remix
Hint
The fly.toml file tells Fly.io your app's name and how to build it.
2
Add a Dockerfile to containerize the Remix app
Create a file named Dockerfile in your project root with these exact lines:
FROM node:18-alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
RUN npm run build
CMD ["npm", "run", "start"]
Remix
Hint
The Dockerfile defines how to build and run your Remix app inside a container.
3
Initialize the Fly.io app without deploying
Run the command flyctl launch --no-deploy --name my-remix-app in your terminal to initialize the Fly.io app configuration without deploying yet.
Remix
Hint
This command sets up your Fly.io app configuration but does not deploy yet.
4
Deploy your Remix app to Fly.io
Run the command flyctl deploy in your terminal to build and deploy your Remix app to Fly.io.
Remix
Hint
This command uploads your app to Fly.io and makes it live.
Practice
(1/5)
1. What is the main purpose of using flyctl launch when deploying a Remix app to Fly.io?
easy
A. To start the Remix development server locally
B. To create and configure a new Fly.io app for deployment
C. To build the Remix app for production
D. To delete an existing Fly.io app
Solution
Step 1: Understand the role of flyctl launch
This command initializes a new Fly.io app by creating configuration files and setting up the app environment.
Step 2: Differentiate from other commands
Unlike flyctl deploy which publishes the app, flyctl launch prepares the app for deployment.
Final Answer:
To create and configure a new Fly.io app for deployment -> Option B