Vela commited on
Commit
fee11be
·
1 Parent(s): b2600cc

updated docker file

Browse files
Dockerfile CHANGED
@@ -1,18 +1,34 @@
1
- FROM python:3.9
2
-
3
- RUN useradd -m -u 1000 user
4
- USER user
5
- ENV PATH="/home/user/.local/bin:$PATH"
6
 
7
  WORKDIR /app
8
 
9
- COPY --chown=user ./requirements.txt requirements.txt
10
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- COPY --chown=user . /app
 
13
 
14
- # Expose the port Streamlit runs on (default 8501)
15
- EXPOSE 8501
16
 
17
- # Run Streamlit app
18
- CMD ["streamlit", "run", "src/frontend/app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
1
+ FROM python:3.11
 
 
 
 
2
 
3
  WORKDIR /app
4
 
5
+ # Copy requirements first for better caching
6
+ COPY requirements.txt /app/
7
+
8
+ # Install dependencies and upgrade pip
9
+ RUN pip install --no-cache-dir --upgrade pip \
10
+ && pip install --no-cache-dir -r requirements.txt
11
+
12
+ # Copy remaining application code
13
+ COPY . /app
14
+
15
+ # Create logs directory with proper permissions
16
+ RUN mkdir -p /app/logs /app/.cache/huggingface && chmod -R 777 /app/logs /app/.cache/huggingface
17
+ RUN mkdir -p /app/src/backend/data && chmod 775 /app/src/backend/data
18
+
19
+
20
+
21
+ # Install additional dependencies
22
+ RUN apt-get update && apt-get install -y tmux curl
23
+
24
+ # Ensure the Hugging Face cache is set correctly
25
+ ENV HF_HOME="/app/.cache/huggingface"
26
 
27
+ # Set Python path
28
+ ENV PYTHONPATH="/app/src"
29
 
30
+ # Expose ports for both FastAPI (8000) and Streamlit (7860)
31
+ EXPOSE 8000 7860
32
 
33
+ # Combined startup with better control
34
+ CMD ["sh", "-c", "streamlit run src/frontend/app.py --server.port 7860 --server.address 0.0.0.0"]
src/frontend/__pycache__/home_page.cpython-313.pyc CHANGED
Binary files a/src/frontend/__pycache__/home_page.cpython-313.pyc and b/src/frontend/__pycache__/home_page.cpython-313.pyc differ
 
src/frontend/app.py CHANGED
@@ -1,5 +1,4 @@
1
- import home_page
2
  from utils import common_functions
3
 
4
  common_functions.set_up_page()
5
- home_page.navbar_with_title()
 
 
1
  from utils import common_functions
2
 
3
  common_functions.set_up_page()
4
+ common_functions.navbar_with_title()
src/frontend/home_page.py CHANGED
@@ -1,85 +1,4 @@
1
- import streamlit as st
2
 
3
- def page_title():
4
- st.markdown("""
5
- <style>
6
- .title {
7
- text-align: left;
8
- font-size: 48px;
9
- font-weight: bold;
10
- color: #2E3A59;
11
- padding-bottom: 10px;
12
- border-bottom: 3px solid #FF6F61;
13
- display: inline-block;
14
- }
15
- </style>
16
- <h1 class="title">Welcome to JB Events & Management</h1>
17
- """, unsafe_allow_html=True)
18
-
19
- def navbar_with_title():
20
- st.markdown(f"""
21
- <style>
22
- .navbar {{
23
- display: flex;
24
- align-items: center;
25
- justify-content: space-between;
26
- width: 100%;
27
- padding: 1px 30px;
28
- background-color: #1F1F1F; /* Dark background */
29
- border-radius: 50px;
30
- box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
31
- }}
32
-
33
- .left-section {{
34
- color: white;
35
- display: flex;
36
- align-items: center;
37
- gap: 15px;
38
- }}
39
-
40
- .menu {{
41
- display: flex;
42
- gap: 20px;
43
- }}
44
- .menu a {{
45
- color: white;
46
- text-decoration: none;
47
- font-weight: bold;
48
- font-size: 16px;
49
- transition: color 0.3s, transform 0.2s;
50
- }}
51
- .menu a:hover {{
52
- color: #FFD700; /* Gold hover effect */
53
- transform: scale(1.1);
54
- }}
55
-
56
- .contact {{
57
- color: white;
58
- font-size: 16px;
59
- font-weight: bold;
60
- }}
61
- @media (max-width: 768px) {{
62
- .navbar {{
63
- flex-direction: column;
64
- align-items: center;
65
- text-align: center;
66
- }}
67
- }}
68
- </style>
69
-
70
- <div class="navbar">
71
- <div class="left-section">
72
- <h1 class="title">JB Events & Management</h1>
73
- </div>
74
- <div class="menu">
75
- <a href="#">HOME</a>
76
- <a href="#">ABOUT US</a>
77
- <a href="#">SERVICES</a>
78
- <a href="#">GALLERY</a>
79
- <a href="#">CONTACT US</a>
80
- </div>
81
- <div class="contact">
82
- 📞 +91-744-888-6668
83
- </div>
84
- </div>
85
- """, unsafe_allow_html=True)
 
1
+ from utils import common_functions
2
 
3
+ common_functions.set_up_page()
4
+ common_functions.navbar_with_title()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/frontend/utils/__pycache__/common_functions.cpython-313.pyc CHANGED
Binary files a/src/frontend/utils/__pycache__/common_functions.cpython-313.pyc and b/src/frontend/utils/__pycache__/common_functions.cpython-313.pyc differ
 
src/frontend/utils/common_functions.py CHANGED
@@ -6,4 +6,72 @@ PAGE_TITLE = 'JB Events'
6
  INITIAL_SIBEBAR_STATE = 'collapsed'
7
 
8
  def set_up_page():
9
- st.set_page_config(page_icon=PAGE_ICON,layout=PAGE_LAYOUT,page_title=PAGE_TITLE,initial_sidebar_state=INITIAL_SIBEBAR_STATE)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  INITIAL_SIBEBAR_STATE = 'collapsed'
7
 
8
  def set_up_page():
9
+ st.set_page_config(page_icon=PAGE_ICON,layout=PAGE_LAYOUT,page_title=PAGE_TITLE,initial_sidebar_state=INITIAL_SIBEBAR_STATE)
10
+
11
+ def navbar_with_title():
12
+ st.markdown(f"""
13
+ <style>
14
+ .navbar {{
15
+ display: flex;
16
+ align-items: center;
17
+ justify-content: space-between;
18
+ width: 100%;
19
+ padding: 1px 30px;
20
+ background-color: #1F1F1F; /* Dark background */
21
+ border-radius: 50px;
22
+ box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
23
+ }}
24
+
25
+ .left-section {{
26
+ color: white;
27
+ display: flex;
28
+ align-items: center;
29
+ gap: 15px;
30
+ }}
31
+
32
+ .menu {{
33
+ display: flex;
34
+ gap: 20px;
35
+ }}
36
+ .menu a {{
37
+ color: white;
38
+ text-decoration: none;
39
+ font-weight: bold;
40
+ font-size: 16px;
41
+ transition: color 0.3s, transform 0.2s;
42
+ }}
43
+ .menu a:hover {{
44
+ color: #FFD700; /* Gold hover effect */
45
+ transform: scale(1.1);
46
+ }}
47
+
48
+ .contact {{
49
+ color: white;
50
+ font-size: 16px;
51
+ font-weight: bold;
52
+ }}
53
+ @media (max-width: 768px) {{
54
+ .navbar {{
55
+ flex-direction: column;
56
+ align-items: center;
57
+ text-align: center;
58
+ }}
59
+ }}
60
+ </style>
61
+
62
+ <div class="navbar">
63
+ <div class="left-section">
64
+ <h1 class="title">JB Events & Management</h1>
65
+ </div>
66
+ <div class="menu">
67
+ <a href="#">HOME</a>
68
+ <a href="#">ABOUT US</a>
69
+ <a href="#">SERVICES</a>
70
+ <a href="#">GALLERY</a>
71
+ <a href="#">CONTACT US</a>
72
+ </div>
73
+ <div class="contact">
74
+ 📞 +91-744-888-6668
75
+ </div>
76
+ </div>
77
+ """, unsafe_allow_html=True)