Skip to content

A starting point for deploying a Wordpress application to fly.io

Notifications You must be signed in to change notification settings

hunterashaw/wordpress-fly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wordpress on fly.io

A starting point for deploying a Wordpress application to fly.io.

Based on wordpress-env.

Features

  • Fully dockerized & repeatable.
  • Uses SQLite plugin simple database management.
  • Runs on locally & on fly.io

Prerequisites

WIP

  • This doesn't cover getting wp-content/uploads to persist within a volume, but this can be done using the instructions for the database volume

Local Setup & Startup

Same as wordpress-env

Deployment

  1. Create fly.io application:
fly launch
  1. Fill out fly launch questions:
Question Tip
Choose an app name (leave blank to generate one): Must be globally unique
Choose a region for deployment: Pick the closest region (remember the 3-letter code)
Would you like to set up a Postgresql database now? No
Would you like to set up an Upstash Redis database now? No
Create .dockerignore from 1 .gitignore files? Yes
Would you like to deploy now? No (we stil need to set up a volume)
  1. Create a volume for the wp-content/database directory. This creates a 1gb volume associated with our new app (make sure you replace $REGION_CODE with the 3-letter code from above):
fly volumes create wordpress_database --region $REGION_CODE --size 1
  1. Replace the [env] line in fly.toml with the following lines:
[build.args]
  PORT=8080

[mounts]
  source="wordpress_database"
  destination="/var/www/html/wp-content/database"

[env]
  WORDPRESS_CONFIG_EXTRA=""
  1. Deploy app:
fly deploy
  1. Ensure deployment was successful. You can view the deployment progress in your fly.io dashboard > [your new app] > Monitoring

  2. SSH into VM and fix volume permission issue. fly.io gives the root user ownership of the mounted volume, which we must manually fix by running:

fly ssh console
chown -R www-data /var/www/html/wp-content/database
  1. Go to the application URL listed in your fly.io dashboard > [your new app] > Overview

  2. Follow the Wordpress installation instructions.

About

A starting point for deploying a Wordpress application to fly.io

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages