This is an example "hello world" Adonis JS project for deployment to fly.io
- Install AdonisJS as per the documentation
- Setup a fly.io account
- Write your Adonisjs code as usual
- Build the project with
node ace build --production
- Setup the project for fly.io:
flyctl launch
in the project root (accept/change the defaults as required) - Update the
Dockerfile
- remove the following lines:
COPY . .
RUN npm install && npm run build
- Replace with
COPY ./build .
COPY ./.env.production ./.env
RUN npm install
This update makes the following changes:
- uses the
build
directory as the source for the production server's files - copies the
.env.production
file from the project root to the build root, and renames to.env
- removes the build step, as this has aleady been performed by step 2 above