[add]: Database connection and migrations

This commit is contained in:
VivianDee
2025-03-28 08:38:32 +01:00
parent 3054b7240e
commit 65efe0573a
21 changed files with 431 additions and 19 deletions
+25 -11
View File
@@ -20,25 +20,39 @@ cd repository
```
### 2. Create a `.env` File
### 2. Configure Environment Variables
Before running the application, create a `.env` file in the root directory and add the required environment variables:
Instead of creating a new `.env` file, rename the provided `.env.example` file and update the necessary variables:
```bash
touch .env
cp .env.example .env
```
Then, open the `.env` file and add the following:
Then, open the `.env` file and **update the following variables with your actual configuration:**
```ini
# Environment Variables
BASIC_AUTH_USERNAME=user
BASIC_AUTH_PASSWORD=password
SWAGGER_URL="/documentation"
API_URL="/swagger.json"
- Database credentials:
```ini
DATABASE_USER=your_database_username
DATABASE_PASSWORD=your_database_password
DATABASE_NAME=your_database_name
DATABASE_PORT=5432
```
- App ID and API Key:
```ini
APP_ID=your_app_id
API_KEY=your_api_key
```
This ensures that the application is properly configured with your environment variables.
> **Optional:** Change file permissions for the entrypoint script
```bash
chmod +x scripts/entrypoint.sh
```
This ensures that the application uses secure API keys and app IDs.
---
### 3. Run the Application with Docker Compose