Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
32ae795
refactor: convert to file-scoped namespaces
osm-Jatin Jun 15, 2025
71073b1
chore: apply dotnet format changes
osm-Jatin Jun 15, 2025
9d714d6
refactor: renamed project from DocumentService to OsmoDoc and updated…
osm-Jatin Jun 15, 2025
513819c
refactor: update Dockerfile and docker-compose for OsmoDoc rename
osm-Jatin Jun 15, 2025
570d94f
refactor: update docs directory for OsmoDoc rename
osm-Jatin Jun 15, 2025
9750310
docs: update GitHub documentation files after OsmoDoc rename
osm-Jatin Jun 15, 2025
c0faf50
fix: correct placeholder replacement to avoid extra curly braces in o…
osm-Jatin Jun 16, 2025
78f5ab2
chore: enable nullable reference types in project
osm-Jatin Jun 16, 2025
e9e470f
refactor: streamline PdfDocumentGenerator for cross-platform and NuGe…
osm-Jatin Jun 16, 2025
5358449
feat: configure OsmoDocPdfConfig.WkhtmltopdfPath from app settings
osm-Jatin Jun 16, 2025
7b4db39
feat: add process exit-code check and quote windows tool path to surv…
Jatin-1602 Jun 17, 2025
9bb0fbf
fix: initialize Placeholders list
Jatin-1602 Jun 17, 2025
9d1e0c1
fix: initialise WordDocumentDataRequestDTO non-nullable list properties
Jatin-1602 Jun 17, 2025
54cb335
chore: add project metadata to OsmoDoc.csproj file
osm-Jatin Jun 18, 2025
ce7c55e
feat: make PdfDocumentGenerator class methods asynchronous
osm-Jatin Jun 18, 2025
4ab72ad
feat: add await operator for GeneratePdf function call
osm-Jatin Jun 18, 2025
295d985
feat: make GenerateDocumentByTemplate class methods asynchronous
osm-Jatin Jun 18, 2025
548252e
refactor: remove using block in GetXWPFDocument function
osm-Jatin Jun 18, 2025
d189276
feat: add null checks for ejsData and function parameters
osm-Jatin Jun 19, 2025
325426a
feat: avoid temporary path collisions under concurrent requests by ad…
osm-Jatin Jun 19, 2025
4950f3e
refactor: initialize PDF tool path once at startup
osm-Jatin Jun 19, 2025
3f78650
feat: handle row cell-count mismatch when populating tables
osm-Jatin Jun 19, 2025
5f0e3bf
feat: avoid Task.Run for I/O operations and fix resource disposal
osm-Jatin Jun 19, 2025
4036fb7
docs: update example env
osm-Jatin Jun 18, 2025
1a4dcdd
feat: add login endpoint for generating jwt token
osm-Jatin Jun 19, 2025
a45e495
feat: add Redis service to docker-compose for token storage
osm-Jatin Jun 18, 2025
be6ff13
chore: add StackExchange.Redis package for Redis integration
osm-Jatin Jun 18, 2025
76fcfbf
feat: implement RedisTokenService for JWT token storage and validation
osm-Jatin Jun 18, 2025
1057e4d
feat: add endpoint for revoking token and update login endpoint to sa…
osm-Jatin Jun 19, 2025
104a56a
feat: make header parsing case-insensitive
osm-Jatin Jun 20, 2025
2994eeb
feat: add cancellation token for async operations and pass HttpContex…
osm-Jatin Jun 20, 2025
67d9179
fix: the typo in _tokenStoreService
osm-Jatin Jun 21, 2025
865dded
fix: initialise non-nullable properties in DTOs
osm-Jatin Jun 18, 2025
6c06981
refactor: handle nulls safely while extracting model validation error…
osm-Jatin Jun 19, 2025
ef48c02
feat: add validation check for empty filePath
osm-Jatin Jun 19, 2025
bd29e61
chore: add project metadata to OsmoDoc.csproj file
osm-Jatin Jun 19, 2025
3c537e3
feat: add null checks for configuration path values and reques body
osm-Jatin Jun 19, 2025
539b0e1
refactor: suppress nullable compliler warnigns
osm-Jatin Jun 19, 2025
2147849
feat: add image URL validation and handle nullable Uri safely
osm-Jatin Jun 19, 2025
32b31f9
feat: add constant for Placeholder regex pattern
osm-Jatin Jun 19, 2025
928a94e
feat: remove the redundant try catch blocks
osm-Jatin Jun 21, 2025
880ac8b
feat: add separate ImageData class
osm-Jatin Jun 21, 2025
1b1c4da
feat: add the feature of handling different types of images
osm-Jatin Jun 21, 2025
d565e15
refactor: update the controller according to the separate handling of…
osm-Jatin Jun 21, 2025
ccbff55
feat: add namespace in ImagrData
osm-Jatin Jul 4, 2025
f6650e1
fix: the typo in output file path
osm-Jatin Jul 4, 2025
b0ad8b8
feat: add null check for documentData parameter
osm-Jatin Jul 4, 2025
ae617b4
refactor: make the PdfDocumentGenerator class static
osm-Jatin Jul 4, 2025
411bc5f
fix; the enum values in ImageSourceType
osm-Jatin Jul 4, 2025
95c914b
feat: add null check for request parameter
osm-Jatin Jul 4, 2025
628e093
feat: validate images data before mapping
osm-Jatin Jul 4, 2025
2987711
feat: add authorization to the revoke endpoint
osm-Jatin Jul 4, 2025
fff1e69
refactor: handle all JSON parsing exceptions
osm-Jatin Jul 4, 2025
ce8a1d9
feat: enable Swagger in Production environment
osm-Jatin Jul 4, 2025
b2c59c5
feat: update docker files and env values
osm-Jatin Jul 4, 2025
01a0b7e
refactor: gracefully handle missing .env file
osm-Jatin Jul 5, 2025
1a5f749
refactor: format the code
osm-Jatin Jul 5, 2025
ea8787d
feat: add function for resource cleanup in PdfDocumentGenerator
osm-Jatin Jul 5, 2025
723f4c1
refactor: avoid leaking local absolute paths in build artefacts
osm-Jatin Jul 5, 2025
0f25da9
feat: add conditional validation for Base64 images
osm-Jatin Jul 5, 2025
7f21e52
feat: handle cleanup of files generated by apis in PdfController
osm-Jatin Jul 5, 2025
d4c09b3
feat: handle cleanup of files generated by apis in WordController
osm-Jatin Jul 5, 2025
c524efd
chore: update README file
osm-Jatin Jul 7, 2025
00f803c
refactor: use complete OpenXML Implementation for WordDocumentGenerator
osm-Jatin Jul 7, 2025
af768e1
feat: update EJS execution to use npx for cross-platform compatibility
osm-Jatin Jul 7, 2025
9082d3c
feat: update WordDocumentGenerator with optional logging
osm-Jatin Jul 7, 2025
fd00589
feat: update PdfDocumentGenerator with optional logging
osm-Jatin Jul 7, 2025
303b9ff
chore: remove NPOI package reference
osm-Jatin Jul 7, 2025
1df9fd3
fix: infer image extension from file path or URL if not provided
osm-Jatin Jul 7, 2025
2298678
feat: add flag for deciding cleaning up of input and output files
osm-Jatin Jul 7, 2025
e275e90
feat: update DotEnv.cs to lookup for .env file in nearest parent folder
osm-Jatin Jul 7, 2025
7aea316
refactor: improve image extension validation security
osm-Jatin Jul 7, 2025
15157cc
fix: ensure EJS temp directory is cleaned up after PDF generation
Jatin-1602 Jul 7, 2025
bb719fe
docs: update the DocFX documentation
osm-Jatin Jul 8, 2025
f819c76
doc: add usage guide for the OsmoDoc
osm-Jatin Jul 8, 2025
5e41421
chore: update the readme file
osm-Jatin Jul 8, 2025
2fddf3b
feat: add support for presentation generation
osm-Jatin Oct 12, 2025
20939eb
refactor: pull max_images value from env file
osm-Jatin Oct 13, 2025
e3524dc
chore: bundle the Templates folder into the package
osm-Jatin Oct 13, 2025
bdf861a
refactor: internally handle the Dependency Injections in the OsmoDoc
osm-Jatin Oct 13, 2025
4730774
chore: update the README file
osm-Jatin Oct 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
JWT_KEY=xxx
OPENAI_API_KEY=PLACEHOLDER_REPLACE_WITH_YOUR_OPENAI_API_KEY_BEFORE_USE
MAX_IMAGES=5
OPENAI_MODEL=gpt-5-mini
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Invalid OpenAI model name.

The model name "gpt-5-mini" does not exist in OpenAI's API. As of my knowledge cutoff (March 2025), valid models include gpt-4o, gpt-4o-mini, gpt-4-turbo, gpt-3.5-turbo, etc. This will cause runtime errors when the PPTX generation service attempts to call the OpenAI API.

Please verify the correct model name by searching for the latest OpenAI models:

Apply this diff to use a valid model name:

-OPENAI_MODEL=gpt-5-mini
+OPENAI_MODEL=gpt-4o-mini

🌐 Web query:

What are the current OpenAI chat completion model names available in 2025?

💡 Result:

Here are the main OpenAI chat-completion models available (2025) — concise list of current public models and families:

  • GPT-5. [1]
  • GPT-4.1 family: gpt-4.1, gpt-4.1-mini, gpt-4.1-nano. [2][3]
  • GPT-4 / GPT-4-turbo (and GPT-4 variants such as 32k). [4]
  • GPT-4o family: gpt-4o, gpt-4o-mini (and audio-preview variants). [5][6]
  • GPT-3.5 family: gpt-3.5-turbo (and 16k/other variants). [6]
  • “o‑series” models (OpenAI o1, o1-pro, o3, o3-pro, o3-mini, o4-mini, o3-mini variants). [4][6]

Sources:
[1] Axios / news on GPT-5 (Oct 2025).
[2] OpenAI / GPT-4.1 announcement and coverage.
[3] Reuters / reporting on GPT-4.1 (Apr 2025).
[4] OpenAI release pages for o‑series (o3, o4‑mini) and GPT-4 family.
[5] OpenAI blog: GPT‑4o mini announcement.
[6] OpenAI/API model list and community references showing chat-completions endpoint model names.

If you want, I can fetch and show the exact API model IDs and links to the official OpenAI docs for each item.


Invalid OpenAI model name.

“gpt-5-mini” isn’t a valid model. As of 2025, use “gpt-5” (or a supported mini variant such as “gpt-4.1-mini”).

-OPENAI_MODEL=gpt-5-mini
+OPENAI_MODEL=gpt-5
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
OPENAI_MODEL=gpt-5-mini
OPENAI_MODEL=gpt-5
🤖 Prompt for AI Agents
In .env.example around line 3, the OPENAI_MODEL value is set to an invalid model
name ("gpt-5-mini"); replace it with a supported model name such as "gpt-5" (or
another valid mini variant like "gpt-4.1-mini") to ensure the environment file
uses a recognized OpenAI model identifier.


JWT_KEY=PLACEHOLDER_REPLACE_WITH_STRONG_KEY_MIN_32_CHARS_BEFORE_USE

REDIS_URL=redis:6379

REDIS_HOST=redis
REDIS_PORT=6379

SERVER_PORT=5000

COMPOSE_PROJECT_NAME=osmodoc
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE/pull_request_template_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### Pre-requisites

- [ ] I have gone through the Contributing guidelines for [Submitting a Pull Request (PR)](https://github.com/OsmosysSoftware/document-service/blob/main/CONTRIBUTING.md#submitting-a-pull-request-pr) and ensured that this is not a duplicate PR.
- [ ] I have gone through the Contributing guidelines for [Submitting a Pull Request (PR)](https://github.com/OsmosysSoftware/osmodoc/blob/main/CONTRIBUTING.md#submitting-a-pull-request-pr) and ensured that this is not a duplicate PR.
- [ ] I have performed unit testing for the new feature added or updated to ensure the new features added are working as expected.
- [ ] I have performed preliminary testing to ensure that any existing features are not impacted and any new features are working as expected as a whole.
- [ ] I have added/updated the `.env.example` file with the required values as applicable.
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -352,3 +352,9 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# Docker mount volumes
Temp/

# Additonal Folders
Generated/
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/OsmoDoc.API/bin/Debug/net8.0/OsmoDoc.API.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\\\bNow listening on:\\\\s+(https?://\\\\S+)"
},
Comment on lines +13 to +16
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix over‑escaped serverReadyAction regex (prevents auto-open).

Pattern is over-escaped; VS Code expects double backslashes in JSON. Use this:

-            "serverReadyAction": {
-                "action": "openExternally",
-                "pattern": "\\\\bNow listening on:\\\\s+(https?://\\\\S+)"
-            },
+            "serverReadyAction": {
+                "action": "openExternally",
+                "pattern": "\\bNow listening on:\\s+(https?://\\S+)"
+            },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\\\bNow listening on:\\\\s+(https?://\\\\S+)"
},
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
🤖 Prompt for AI Agents
.vscode/launch.json around lines 13-16: the serverReadyAction regex is
over-escaped and fails to match, preventing automatic opening; replace the
current over-escaped pattern with a correctly escaped JSON string that uses
double backslashes for the word-boundary, whitespace and non-space character
classes (i.e. use \\b for \b, \\s for \s, and \\S for \S), keep the capturing
group for the URL and the http/https alternation so the "Now listening on:
<url>" line is matched and VS Code can auto-open the server URL.

"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
}
]
}
41 changes: 41 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/OsmoDoc.API/OsmoDoc.API.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/OsmoDoc.API/OsmoDoc.API.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/OsmoDoc.API/OsmoDoc.API.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
32 changes: 16 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Contributing to DocumentService
Welcome to the document-service project! We appreciate your interest in contributing to the project and making it even better. As a contributor,
# Contributing to OsmoDoc
Welcome to the osmodoc project! We appreciate your interest in contributing to the project and making it even better. As a contributor,
please follow the guidelines outlined below:

## Table of contents
Expand All @@ -13,8 +13,8 @@ please follow the guidelines outlined below:
## Got a question or problem?

**If you have questions or encounter problems, please refrain from opening issues for general support questions**. GitHub issues are primarily for bug
reports and feature requests. For general questions and support, consider using [Stack Overflow](https://stackoverflow.com/questions/tagged/document-service)
and tag your questions with the `document-service` tag. Here's why Stack Overflow is a preferred platform:
reports and feature requests. For general questions and support, consider using [Stack Overflow](https://stackoverflow.com/questions/tagged/osmodoc)
and tag your questions with the `osmodoc` tag. Here's why Stack Overflow is a preferred platform:

- Questions and answers are publicly available, helping others.
- The voting system on Stack Overflow highlights the best answers.
Expand All @@ -23,8 +23,8 @@ To save time for both you and us, we will close issues related to general suppor

## Found any issues and bugs

If you find a bug in the source code, you can help us by [submitting an issue](https://github.com/OsmosysSoftware/document-service/issues/new)
to our GitHub Repository. Even better, you can submit a [pull request](https://github.com/OsmosysSoftware/document-service/pulls) with a fix.
If you find a bug in the source code, you can help us by [submitting an issue](https://github.com/OsmosysSoftware/osmodoc/issues/new)
to our GitHub Repository. Even better, you can submit a [pull request](https://github.com/OsmosysSoftware/osmodoc/pulls) with a fix.
Comment on lines +26 to +27
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Minor style/capitalization nits.

Lowercase “repository”; tighten wording.

-If you find a bug in the source code, you can help us by [submitting an issue](https://github.com/OsmosysSoftware/osmodoc/issues/new) 
-to our GitHub Repository. Even better, you can submit a [pull request](https://github.com/OsmosysSoftware/osmodoc/pulls) with a fix.
+If you find a bug, please [submit an issue](https://github.com/OsmosysSoftware/osmodoc/issues/new)
+to our GitHub repository. Even better, submit a [pull request](https://github.com/OsmosysSoftware/osmodoc/pulls) with a fix.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
If you find a bug in the source code, you can help us by [submitting an issue](https://github.com/OsmosysSoftware/osmodoc/issues/new)
to our GitHub Repository. Even better, you can submit a [pull request](https://github.com/OsmosysSoftware/osmodoc/pulls) with a fix.
If you find a bug, please [submit an issue](https://github.com/OsmosysSoftware/osmodoc/issues/new)
to our GitHub repository. Even better, submit a [pull request](https://github.com/OsmosysSoftware/osmodoc/pulls) with a fix.
🤖 Prompt for AI Agents
In CONTRIBUTING.md around lines 26 to 27, the wording uses “Repository” and is
slightly loose; change “Repository” to lowercase “repository” and tighten the
sentence for concision — e.g., rephrase to “submit an issue to our GitHub
repository” and streamline the follow-up sentence to “or, even better, open a
pull request with a fix.” Ensure punctuation and capitalization follow the
project style.


## Submission guidelines

Expand All @@ -34,19 +34,19 @@ Before you submit an issue, please check the issue tracker to see if a similar i

For us to address and fix a bug, we need to reproduce it. Thus when submitting a bug report, we will ask for a minimal reproduction scenario using a repository or [Gist](https://gist.github.com/). Providing a live, reproducible scenario helps us understand the issue better. Information to include:

- The version of the document-service you are using.
- The version of the osmodoc you are using.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Grammar: drop article and fix casing.

-- The version of the osmodoc you are using.
+- The version of OsmoDoc you are using.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In CONTRIBUTING.md around line 37, the sentence "The version of the osmodoc you
are using." should drop the leading article and fix casing; replace it with
"Version of OsmoDoc you are using." to remove "The" and capitalize the project
name consistently.

- Any third-party libraries and their versions.
- A use-case that demonstrates the issue.

Without a minimal reproduction, we may need to close the issue due to insufficient information.

You can file new issues using our [new issue form](https://github.com/OsmosysSoftware/document-service/issues/new).
You can file new issues using our [new issue form](https://github.com/OsmosysSoftware/osmodoc/issues/new).

### Submitting a pull request (PR)

Before submitting a Pull Request (PR), please follow these guidelines:

1. Search GitHub [pull requests](https://github.com/OsmosysSoftware/document-service/pulls) to ensure there is no open or closed PR
1. Search GitHub [pull requests](https://github.com/OsmosysSoftware/osmodoc/pulls) to ensure there is no open or closed PR
related to your submission.
2. Fork this repository.
3. Make your changes in a new Git branch.
Expand All @@ -63,12 +63,12 @@ Before submitting a Pull Request (PR), please follow these guidelines:
```shell
git push origin my-fix-branch
```
7. Send a pull request to the `document-service:main`.
7. Send a pull request to the `osmodoc:main`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix garbled bullets and minor wording; current HTML/� chars won’t render correctly.

Replace with plain Markdown bullets and clarify target.

-7. Send a pull request to the `osmodoc:main`.
+7. Open a pull request against `osmodoc:main`.
-- <strong style="color:black">�</strong> **If we suggest changes, then:**
-  - � Make the required updates.
-  - � Ensure that your changes do not break existing functionality or introduce new issues.
-  - � Rebase your branch and force push to your GitHub repository. This will update your Pull Request.
+- **If we suggest changes, then:**
+  - Make the required updates.
+  - Ensure your changes do not break existing functionality or introduce issues.
+  - Rebase your branch and force-push to update your pull request.

Also applies to: 68-71

🤖 Prompt for AI Agents
In CONTRIBUTING.md around line 66 (and similarly lines 68–71), the list item
contains garbled bullets/HTML characters; replace the offending line with a
plain Markdown bullet and clearer wording such as "Send a pull request to
osmodoc:main" (or "Create a pull request targeting the osmodoc/main branch") and
update the nearby bullet lines 68–71 to use standard Markdown hyphens or
asterisks and plain text only so they render correctly.


- <strong style="color:black">�</strong> **If we suggest changes, then:**
- � Make the required updates.
- � Ensure that your changes do not break existing functionality or introduce new issues.
- � Rebase your branch and force push to your GitHub repository. This will update your Pull Request.
- <strong style="color:black">�</strong> **If we suggest changes, then:**
- � Make the required updates.
- � Ensure that your changes do not break existing functionality or introduce new issues.
- � Rebase your branch and force push to your GitHub repository. This will update your Pull Request.

That's it! Thank you for your contribution!

Expand All @@ -90,7 +90,7 @@ To ensure consistency throughout the source code, follow these rules as you work
## Commit message guidelines

In this project, we have specific rules for formatting our Git commit messages. These guidelines result in more readable messages that are easy
to follow when reviewing the project's history. Additionally, we use these commit messages to **generate the document-service change log**.
to follow when reviewing the project's history. Additionally, we use these commit messages to **generate the osmodoc change log**.

### Commit message format

Expand All @@ -110,7 +110,7 @@ on GitHub as well as in various git tools.

Footer should contain a [closing reference to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if any.

Samples: (even more [samples](https://github.com/OsmosysSoftware/document-service/commits/main))
Samples: (even more [samples](https://github.com/OsmosysSoftware/osmodoc/commits/main))
`docs: update change log to beta.5`
`fix: need to depend on latest rxjs and zone.js`

Expand Down
50 changes: 27 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,51 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app

# Expose the desired port
ENV ASPNETCORE_ENVIRONMENT=Development
EXPOSE 5000

# Build configuration variable. Debug as default
ENV BUILD_CONFIGURATION=Debug
# Build configuration variable. Debug for development, Release for production
ENV BUILD_CONFIGURATION=Release
ENV ASPNETCORE_ENVIRONMENT=Production

# Copy data
COPY ["DocumentService.API/DocumentService.API.csproj", "DocumentService.API/"]
COPY ["DocumentService/DocumentService.csproj", "DocumentService/"]
# Copy the solution and project files
COPY *.sln ./
COPY ./OsmoDoc.API/OsmoDoc.API.csproj OsmoDoc.API/
COPY ./OsmoDoc/OsmoDoc.csproj OsmoDoc/

# Restore the project dependencies
RUN dotnet restore "./DocumentService.API/./DocumentService.API.csproj"
RUN dotnet restore "./DocumentService/./DocumentService.csproj"
# Restore dependencies
RUN dotnet restore OsmoDoc.API/OsmoDoc.API.csproj

# Copy the rest of the data
COPY . .
WORKDIR "/app/DocumentService.API"
# Copy required project files
COPY ./OsmoDoc.API/ OsmoDoc.API/
COPY ./OsmoDoc/ OsmoDoc/
COPY .env .

# Build the project and store artifacts in /out folder
RUN dotnet publish "./DocumentService.API.csproj" -c BUILD_CONFIGURATION -o /app/out
RUN dotnet publish OsmoDoc.API/OsmoDoc.API.csproj -c $BUILD_CONFIGURATION -o out

# Use the official ASP.NET runtime image as the base image
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base

WORKDIR /app

ENV ASPNETCORE_URLS=http://+:5000

# Copy the published artifacts from the build stage
COPY --from=build /app/out .

# Install only necessary dependencies for wkhtmltopdf, Node.js and npm
RUN apt-get update \
&& apt-get install -y --fix-missing wkhtmltopdf \
&& apt-get install -y --fix-missing nodejs \
&& apt-get install -y --no-install-recommends npm \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends \
wkhtmltopdf \
nodejs \
npm && \
rm -rf /var/lib/apt/lists/*

# Install wkhtmltopdf and allow execute access
RUN chmod 755 /usr/bin/wkhtmltopdf

# Install ejs globally without unnecessary dependencies
# Install EJS globally
RUN npm install -g --only=prod ejs

# Expose the API port
EXPOSE 5000

# Set the entry point for the container
ENTRYPOINT ["dotnet", "DocumentService.API.dll"]
ENTRYPOINT ["dotnet", "OsmoDoc.API.dll"]
13 changes: 0 additions & 13 deletions DocumentService.API/Helpers/AutoMappingProfile.cs

This file was deleted.

13 changes: 0 additions & 13 deletions DocumentService.API/Models/PdfGenerationRequestDTO.cs

This file was deleted.

24 changes: 0 additions & 24 deletions DocumentService.API/Models/WordGenerationRequestDTO.cs

This file was deleted.

14 changes: 0 additions & 14 deletions DocumentService/DocumentService.csproj

This file was deleted.

10 changes: 0 additions & 10 deletions DocumentService/Pdf/Models/ContentMetaData.cs

This file was deleted.

11 changes: 0 additions & 11 deletions DocumentService/Pdf/Models/DocumentData.cs

This file was deleted.

Loading