Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 3.04 KB

readme.md

File metadata and controls

79 lines (56 loc) · 3.04 KB

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.