-
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.
fix: Mind maps were corrected and sent to the user in html format
- Also updated the time formater - Integrates with docker for deployment
- Loading branch information
Showing
7 changed files
with
67 additions
and
27 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,45 @@ | ||
# Use an official Python runtime as a parent image | ||
FROM python:3.10-slim AS base | ||
|
||
# Install git to handle submodules | ||
RUN apt-get update && apt-get install -y git | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the requirements file into the container | ||
COPY requirements.txt . | ||
|
||
# Create and activate a virtual environment | ||
RUN python -m venv /venv | ||
ENV PATH="/venv/bin:$PATH" | ||
|
||
# Install Python dependencies | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# Use an official Node.js runtime as a parent image | ||
FROM node:18-slim AS node_base | ||
|
||
# Install npx globally | ||
RUN npm install -g npx --force | ||
|
||
# Use the base image | ||
FROM base AS final | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy the installed npx from the Node.js image | ||
COPY --from=node_base /usr/local/bin/npx /usr/local/bin/npx | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Copy the .env file into the container | ||
COPY .env . | ||
|
||
# Initialize and update git submodules | ||
RUN git submodule init && git submodule update | ||
|
||
# Define the command to run the application | ||
CMD ["python", "-m", "app.main"] |
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
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,21 +1 @@ | ||
# aura/app/utils/parser.py | ||
|
||
import cairosvg | ||
|
||
|
||
def convert_html_to_svg(html: str, output_file: str) -> None: | ||
""" | ||
Convert HTML to SVG | ||
""" | ||
with open(html, "r", encoding="uft-8") as file: | ||
html_content = file.read() | ||
cairosvg.svg2svg(html_content, write_to=output_file) | ||
|
||
|
||
def convert_html_to_png(html: str, output_file: str) -> None: | ||
""" | ||
Convert HTML to PNG | ||
""" | ||
with open(html, "r", encoding="utf-8") as file: | ||
html_content = file.read() | ||
cairosvg.svg2png(html_content, write_to=output_file) |
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