Containerized AdonisJS + PM2 for portability and development flexibility. This project aims to keep an organized and reusable file structure.
The first thing you need to do is generate an APP_KEY
by simply running ./generate-adonis-app-key.sh
This will create a file containing the key that Adonis uses for encryption.
After you have the adonis.appkey.v1
file created, you can then run docker-compose up
The docker-compose.override.yml
is automatically picked up and is used or local dev.
In local development, the Adonis app will automatically reload.
Deploying this example into Docker Swarm, you would use something like:
docker stack deploy -c docker-compose.yml adonis
Where docker-compose.override.yml
would not get picked up.
- Dockerfiles and related container artifacts don't belong in your app's root folder.
- Use docker-compose.override.yml for local development
|-[app]
|---[myapp]
|-----...the-adonis-app-files
|-[build]
|---[myapp]
|-----...Dockerfile
|-docker-secrets
|---adonis.appkey.v1