Fast Phoenix Docs
  • 🚀What is Fast Phoenix?
  • 😍Main Features
  • 💡Changelog
  • Getting Started
    • ⏩Quickstart
    • 🌏Go Live!
  • 🌟Features
    • 💳Stripe
    • 📧Mailgun
    • 📨Premade Email Templates
    • 📩Email Templates & Sending
    • 🏢Organizations
    • 😇Admin
    • 🛬Landing Page
    • 🏳️‍🌈Themes
    • 🔍SEO
  • 🧱Components
    • Theme Selector
    • Testimonials
    • Call to Action
    • Faq's
    • Features
    • Header
    • Footer
    • Hero
    • Login/Register
    • Mobile Hero
    • Sidebar
    • Trust
    • Card
Powered by GitBook
On this page
  • A few things before you go live:
  • Launching to fly.io:
  • Add NPM & Nodejs for js package DaisyUI to Dockerfile:
  • Re-deploy App:
  • Add your production .env variables to envs/.env.prod
  1. Getting Started

Go Live!

PreviousQuickstartNextStripe

Last updated 5 months ago

A few things before you go live:

Launching to fly.io:

Fly seems to be the easiest and cheapest option for phoenix apps, so that's what we'll use for our guide.

If you haven't already, download the . Then you will need to .

Create a new project by running this command:

flyctl launch

Follow the steps in the CLI, usually the default setup it best, unless you want to change the name of the project.

At this point, it will try to generate and deploy the app, but may fail. We need to make some changes for the launch to succeed. Run this command and follow the next steps.

mix phx.gen.release --docker

Add NPM & Nodejs for js package DaisyUI to Dockerfile:

Add this code after the install build dependencies command, and above the WORKDIR /app command.

# Install Node.js and npm
RUN apt-get update -y && \
    apt-get install -y curl gnupg && \
    curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor -o /usr/share/keyrings/nodesource.gpg && \
    echo "deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x bullseye main" > /etc/apt/sources.list.d/nodesource.list && \
    apt-get update -y && \
    apt-get install -y nodejs

Then add this below the COPY assets assets command:

RUN npm install --prefix assets/

Then below this line:

COPY --from=builder --chown=nobody:root /app/_build/${MIX_ENV}/rel/phx_saas ./

Copy the following:

# Install dos2unix to fix CRLF line endings
RUN apt-get update && apt-get install -y dos2unix

# Convert all .sh files to use LF line endings
RUN find /app -type f -name "*.sh" -exec dos2unix {} +

# Ensure /app/bin/migrate and other scripts are executable
RUN chmod +x /app/bin/migrate

This is to ensure proper line endings. (We have run into deployment problems many times due to this)

Re-deploy App:

Run the command below to successfully deploy your new app.

flyctl deploy

Add your production .env variables to envs/.env.prod

Change your Canonical url to your host domain eg. "domain.com" in config.ex & root.html.heex.

And you're set!

🌏
Fly.io CLI
register or sign in