-
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.
- Loading branch information
Showing
4 changed files
with
92 additions
and
22 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 |
---|---|---|
@@ -1,24 +1,26 @@ | ||
# Use the official Python image as a base image | ||
# Use official Python image | ||
FROM python:3.10 | ||
|
||
# Set the working directory in the container | ||
# Set environment variables for Flask | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy the requirements file into the container | ||
# Copy requirements file and install dependencies | ||
COPY requirements.txt . | ||
RUN pip install -r requirements.txt | ||
|
||
# Install the dependencies | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Copy the entire application into the container | ||
# Copy project files | ||
COPY . . | ||
|
||
# Set environment variables | ||
ENV FLASK_APP=app | ||
ENV FLASK_ENV=development | ||
# Install npm and necessary packages (for running Tailwind CSS commands) | ||
RUN apt-get update && apt-get install -y nodejs npm | ||
WORKDIR /app/app # Move to where `package.json` is located | ||
RUN npm install | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 5000 | ||
# Expose Flask port | ||
EXPOSE 8000 | ||
|
||
# Command to run the application | ||
CMD ["flask", "run", "--host=0.0.0.0"] | ||
# Command to run on container start | ||
CMD ["flask", "--app", "app", "run", "--host=0.0.0.0", "--port=8000", "--debug"] |
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,28 @@ | ||
pandas | ||
numpy | ||
matplotlib | ||
seaborn | ||
dbt | ||
dbt-postgres | ||
psycopg2 | ||
psycopg2-binary | ||
telethon | ||
sqlalchemy | ||
databases | ||
scikit-learn | ||
scipy | ||
python-dotenv | ||
xgboost | ||
mlflow | ||
imblearn | ||
tensorflow | ||
shap | ||
lime | ||
mlflow | ||
flask | ||
click | ||
flask_sqlalchemy | ||
Flask-Migrate | ||
pytest | ||
dbt | ||
dash |
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,22 +1,40 @@ | ||
services: | ||
flask: | ||
web: | ||
build: . | ||
container_name: flask_app | ||
command: flask --app app run --host=0.0.0.0 --port=8000 --debug | ||
ports: | ||
- "5000:5000" | ||
- "8000:8000" | ||
environment: | ||
- DATABASE_URL=${DATABASE_URL} | ||
- FLASK_APP=app | ||
- FLASK_SECRET_KEY=${FLASK_SECRET_KEY} | ||
- SQLALCHEMY_DATABASE_URI=postgresql://postgres:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB} | ||
- ENVIRONMENT=${ENVIRONMENT} | ||
depends_on: | ||
- db | ||
- css | ||
volumes: | ||
- .:/app | ||
|
||
db: | ||
image: postgres:17 | ||
restart: always | ||
container_name: postgres_db | ||
environment: | ||
- POSTGRES_DB=${POSTGRES_DB} | ||
- POSTGRES_USER=${POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
POSTGRES_DB: ${POSTGRES_DB} | ||
POSTGRES_USER: ${POSTGRES_USER} | ||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | ||
ports: | ||
- "5432:5432" | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
|
||
css: | ||
image: node:14 | ||
container_name: css_processor | ||
working_dir: /app/app | ||
volumes: | ||
- .:/app | ||
command: ["npm", "run", "create-css"] | ||
|
||
volumes: | ||
postgres_data: | ||
postgres_data: |
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,22 @@ | ||
services: | ||
- type: web | ||
name: css-builder | ||
env: node | ||
buildCommand: "npm install" | ||
startCommand: "npx tailwindcss -i ./static/src/input.css -o ./static/css/main.css --minify" | ||
plan: free | ||
|
||
- type: web | ||
name: init-db | ||
env: python | ||
buildCommand: "pip install -r requirements.txt" | ||
startCommand: "flask --app app init-db" | ||
plan: free | ||
autoDeploy: false | ||
|
||
- type: web | ||
name: flask-dash-app | ||
env: python | ||
buildCommand: "pip install -r requirements.txt" | ||
startCommand: "flask --app app run --host 0.0.0.0 --port 8000 --debug" | ||
plan: free |