This is the boilerplate for creating an API server in AdonisJs, it comes pre-configured with.
- Bodyparser
- Authentication
- CORS
- Lucid ORM
- Migrations and seeds
- Redis
- Kue (Queue)
- Swagger 2 docs (./docs/swagger)
Use the adonis command to install the blueprint
git clone --dissociate https://github.com/reg2005/adonis-api-app-with-docker
For example: my-adonis-app.loc And set it in /etc/hosts
127.0.0.1 my-adonis-app.loc
Please copy ./docker/reverseProxy folder in global env. NginxReverseProxy listen 80 port and proxying traffic to your app. Use it as one instance!
cd yourNginxReverseFolder
docker-compose up -d
Copy .env.example to .env and set variables
- REAL_URL=my-adonis-app.loc
- DB_USER=custom_user
- DB_PASSWORD=custom_password
- DB_DATABASE-custom_db
docker-compose up -d
docker-compose exec app bash -c 'yarn install && adonis key:generate'
docker-compose restart
For example: http://my-adonis-app.loc/
Run the following command to run startup migrations.
docker-compose exec app bash -c 'adonis migration:run'
Run the following command to run startup migrations.
docker-compose exec app bash
For all containers
docker-compose logs -f
Or selected container
docker-compose logs -f app
Troubleshooting If you get nginx "Not found error":
docker-compose restart
Or view logs and find bugs
docker-compose logs -f web