-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from bassfinity/27-containerized-the-applicati…
…on-for-use-in-kubernetes Fixes Containerized the application for use in Kubernetes #27
- Loading branch information
Showing
7 changed files
with
104 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Use an official Python image as the base | ||
FROM python:3.9-slim | ||
|
||
# Set environment variables to ensure Python behaves well in Docker | ||
ENV PYTHONDONTWRITEBYTECODE=1 \ | ||
PYTHONUNBUFFERED=1 | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Install system dependencies for Python and the app (e.g., build tools, if needed) | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
libpq-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy only the requirements first for efficient Docker caching | ||
COPY requirements.txt /app/requirements.txt | ||
|
||
# Install Python dependencies | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the rest of the application code | ||
COPY . /app | ||
|
||
# Expose the application's port (adjust if needed) | ||
EXPOSE 5000 | ||
|
||
# Health check to ensure the app is running | ||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ | ||
CMD curl --fail http://localhost:5000/health || exit 1 | ||
|
||
# Default command to run the application | ||
CMD ["python", "app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# src/data_acquisition.py | ||
|
||
import os | ||
import requests | ||
import streamlit as st | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# src/data_processing.py | ||
|
||
from datetime import datetime | ||
|
||
def process_solunar_data(data, date_str): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# src/recommendation_engine.py | ||
|
||
def generate_recommendations(major_times, minor_times): | ||
recommendations = [] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# src/solunar_calculations.py | ||
|
||
from datetime import timedelta | ||
|
||
def calculate_major_minor_times(solunar_data): | ||
|