T-K-O-H commited on
Commit
0b4a72e
·
1 Parent(s): 600c235

Update code to use environment variables and improve error handling

Browse files
Files changed (2) hide show
  1. Dockerfile +4 -4
  2. chainlit.md +0 -55
Dockerfile CHANGED
@@ -10,7 +10,7 @@ RUN apt-get update && apt-get install -y \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
  # Create a non-root user
13
- RUN useradd -m -u 1000 chainlit_user
14
 
15
  # Copy requirements first for better caching
16
  COPY requirements.txt /code/requirements.txt
@@ -21,7 +21,7 @@ COPY . /code/
21
 
22
  # Create necessary directories and set permissions
23
  RUN mkdir -p /code/.files && \
24
- chown -R chainlit_user:chainlit_user /code && \
25
  chmod -R 755 /code
26
 
27
  # Set environment variables
@@ -30,7 +30,7 @@ ENV PORT=7860
30
  ENV PYTHONPATH=/code
31
 
32
  # Switch to non-root user
33
- USER chainlit_user
34
 
35
  # Command to run the application
36
- CMD chainlit run app.py --host $HOST --port $PORT
 
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
  # Create a non-root user
13
+ RUN useradd -m -u 1000 app_user
14
 
15
  # Copy requirements first for better caching
16
  COPY requirements.txt /code/requirements.txt
 
21
 
22
  # Create necessary directories and set permissions
23
  RUN mkdir -p /code/.files && \
24
+ chown -R app_user:app_user /code && \
25
  chmod -R 755 /code
26
 
27
  # Set environment variables
 
30
  ENV PYTHONPATH=/code
31
 
32
  # Switch to non-root user
33
+ USER app_user
34
 
35
  # Command to run the application
36
+ CMD python app.py
chainlit.md DELETED
@@ -1,55 +0,0 @@
1
- # Stock Price & Share Calculator 📈
2
-
3
- Welcome! This app helps you:
4
- 1. Check real-time stock prices
5
- 2. Calculate how many shares you can buy with a specific amount
6
-
7
- ## Quick Start Guide 🚀
8
-
9
- ### 1️⃣ Get Stock Prices
10
- Just type a ticker symbol or company name:
11
- ```
12
- AAPL
13
- ```
14
- or
15
- ```
16
- What's the price of Apple?
17
- ```
18
-
19
- ### 2️⃣ Calculate Shares
20
- Ask how many shares you can afford:
21
- ```
22
- How many AAPL shares can I buy with $10000?
23
- ```
24
-
25
- ## Popular Stocks You Can Try 💎
26
-
27
- ### Tech Companies
28
- - `AAPL` - Apple
29
- - `MSFT` - Microsoft
30
- - `GOOGL` - Google
31
- - `AMZN` - Amazon
32
- - `META` - Meta/Facebook
33
- - `TSLA` - Tesla
34
- - `NVDA` - NVIDIA
35
-
36
- ### Financial
37
- - `JPM` - JPMorgan
38
- - `BAC` - Bank of America
39
- - `GS` - Goldman Sachs
40
-
41
- ### Retail
42
- - `WMT` - Walmart
43
- - `COST` - Costco
44
- - `SBUX` - Starbucks
45
-
46
- ## Tips 💡
47
- - You can use either the ticker (e.g., `AAPL`) or company name (e.g., "Apple")
48
- - Include a dollar amount to calculate shares (e.g., "AAPL $5000")
49
- - All prices are real-time from the market
50
-
51
- Try it now! Type a ticker symbol or ask about any company listed above.
52
-
53
- ## Welcome screen
54
-
55
- To modify the welcome screen, edit the `chainlit.md` file at the root of your project. If you do not want a welcome screen, just leave this file empty.