Skip to content

Commit 5014ea3

Browse files
author
Nikhil Suthar
committed
Fix in docker compose file
1 parent c6710c6 commit 5014ea3

File tree

4 files changed

+19
-34
lines changed

4 files changed

+19
-34
lines changed

docker-compose.local.yml

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -84,43 +84,24 @@ services:
8484
###########################################################################
8585
# 3) Ngrok – expose local FastAPI endpoint
8686
###########################################################################
87+
8788
ngrok:
88-
image: alpine:latest
89-
<<: *envfile
90-
restart: unless-stopped
89+
image: ngrok/ngrok:latest
9190
depends_on: [copilot]
92-
entrypoint: sh
93-
command: -c "
94-
apk add --no-cache curl && \
95-
echo '🔁 Waiting for Copilot...' && \
96-
until curl -sf http://copilot:3978/health > /dev/null; do echo '⏳ Waiting...'; sleep 3; done && \
97-
echo '✅ Copilot is ready. Starting ngrok...' && \
98-
curl -s https://ngrok-agent.s3.amazonaws.com/ngrok.asc | tee /etc/apk/keys/ngrok.asc && \
99-
echo 'https://ngrok-agent.s3.amazonaws.com/alpine edge main' >> /etc/apk/repositories && \
100-
apk add --no-cache ngrok && \
101-
ngrok config add-authtoken $NGROK_AUTHTOKEN && \
102-
ngrok http copilot:3978 --log stdout"
91+
command: http copilot:3978 --log stdout
92+
environment:
93+
NGROK_AUTHTOKEN: ${NGROK_AUTHTOKEN}
10394
ports:
10495
- "4040:4040"
105-
healthcheck:
106-
test: ["CMD", "curl", "-f", "http://localhost:4040/api/tunnels"]
107-
interval: 5s
108-
timeout: 3s
109-
retries: 5
11096
networks: [airflow]
111-
112-
113-
11497
###########################################################################
11598
# 4) Bot updater – patches Azure Bot with ngrok URL
11699
###########################################################################
117100
bot-updater:
118101
image: ${COPILOT_IMAGE:-thedatacarpenter/airflow-copilot:latest}
119102
<<: *envfile
120103
entrypoint: ["/usr/local/bin/update_bot.sh"]
121-
depends_on:
122-
ngrok:
123-
condition: service_healthy
104+
depends_on: [ngrok]
124105
restart: "no"
125106
environment:
126107
NGROK_API: http://ngrok:4040/api/tunnels
@@ -129,4 +110,4 @@ services:
129110
AZURE_CLIENT_ID: ${AZURE_CLIENT_ID:-${MICROSOFT_APP_ID}}
130111
AZURE_TENANT_ID: ${AZURE_TENANT_ID}
131112
AZURE_CLIENT_SECRET: ${AZURE_CLIENT_SECRET:-${MICROSOFT_APP_PASSWORD}}
132-
networks: [airflow]
113+
networks: [airflow]

docker-compose.prod.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ networks:
1111
services:
1212
copilot:
1313
image: thedatacarpenter/airflow-copilot:latest
14-
container_name: copilot
1514
<<: *envfile
1615
ports:
1716
- "3978:3978"
@@ -51,6 +50,9 @@ services:
5150
# -------- Security --------
5251
FERNET_SECRET_KEY: ${FERNET_SECRET_KEY}
5352

53+
volumes:
54+
- ./.env:/app/src/.env:ro
55+
5456
depends_on: [db-init]
5557
networks: [airflow]
5658

docs/configuration/environment_variables.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ This document describes all the environment variables required for running **Air
5858

5959
| Variable | Description | Required |
6060
|----------------------|-----------------------------------------------------------|----------|
61-
| `AZURE_BOT_NAME` | Name of the Bot that you have created. e.g Airflow-Copilot | ||
61+
| `AZURE_BOT_NAME` | Name of the Bot that you have created. e.g Airflow-Copilot | ||
6262
| `NGROK_AUTHTOKEN` |NGROK Auth Token |||
6363

6464
---
@@ -157,15 +157,15 @@ This document describes all the environment variables required for running **Air
157157
- **Required**: ✅ Yes (if `per_user`)
158158
- **Command**: Run below command to generate the key.
159159

160-
```bash
161-
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
162-
```
163-
> *Do not change the Farnet key in every deployment otherwise the backend credentials will not be decrypt and every user have to update their cred again.*
160+
```bash
161+
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
162+
```
163+
> *Do not change the Farnet key in every deployment otherwise the backend credentials will not be decrypt and every user have to update their cred again.*
164164

165165
16. **`AZURE_BOT_NAME`**
166166
- **Description**: The Azure Bot Name to automatically update the endpoint while Local Deployment.
167167
- **Default**: Airflow-Copilot
168-
- **Required**: No
168+
- **Required**: ❌ Optional
169169

170170
17. **`NGROK_AUTHTOKEN`**
171171
- **Description**: The Ngrok Token to deploy the Local Fast API to public Https endpoint.

src/airflow_copilot/config/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# --- Constants ---
1717
ENV_PATH = Path(__file__).resolve().parent.parent.parent / ".env"
18-
logs.info(f"✅ Loaded .env from: {ENV_PATH}")
18+
logs.info(f"✅ Loaded .env from path is: {ENV_PATH}")
1919

2020

2121
# --- Ensure .env file exists ---
@@ -93,6 +93,8 @@ def validate(self):
9393

9494
if missing:
9595
raise ValueError(f"Missing required environment variables: {', '.join(missing)}")
96+
else:
97+
logs.info(f"✅ All the require environment variables get.....")
9698

9799
def encrypt_password(self, password: str) -> str:
98100
if not self._fernet:

0 commit comments

Comments
 (0)