A simple AdonisJS application using the Lucid ORM with the API preset, fully containerized with Docker and PostgreSQL.
- AdonisJS: A Node.js MVC framework.
- Lucid ORM: Elegant ORM for interacting with the PostgreSQL database.
- Dockerized Setup: Easy deployment and environment consistency using Docker and Docker Compose.
- PostgreSQL: Reliable and powerful open-source relational database.
- Docker installed on your machine.
- Docker Compose installed.
Follow these steps to set up and run the project locally.
git clone https://github.com/theoribbi/adonisjs-dockerized-api.git
cd adonisjs-dockerized-apiCopy the example environment file and modify it as needed.
cp .env.example .envOpen the .env file in your preferred text editor and update the values if necessary, especially the database configuration to match the Docker setup.
Ensure that Docker and Docker Compose are running on your machine. Then, execute the following command to build and start the containers:
docker-compose upThis command will set up the AdonisJS application along with a PostgreSQL database.
Once the containers are up and running, you can access the API at:
http://127.0.0.1:3333adonisjs-api/
├── src/
│ ├── app/
│ ├── bin/
│ ├── config/
│ ├── database/
│ ├── start/
│ ├── tests/
│ ├── Dockerfile
│ ├── ace.js
│ ├── adonisrc.ts
│ ├── eslint.config.js
│ ├── package.json
│ └── tsconfig.json
├── .env
├── README.md
└── docker-compose.ymlsrc/: Contains the AdonisJS application source code.- app/: Application code.
- bin/: Binary files.
- config/: Configuration files.
- database/: Database migrations and seeds.
- start/: Entry points and server setup.
- tests/: Test suites.
Contributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.