Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protmpnn microservice #97

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

timurishmuratov7
Copy link
Member

No description provided.

Comment on lines +24 to +27
EXPOSE 8000

# Set the entrypoint to start the FastAPI app
ENTRYPOINT ["uvicorn", "protmpnn.api:app", "--host", "0.0.0.0", "--port", "8000"]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
EXPOSE 8000
# Set the entrypoint to start the FastAPI app
ENTRYPOINT ["uvicorn", "protmpnn.api:app", "--host", "0.0.0.0", "--port", "8000"]
# Set the entrypoint to start the FastAPI app
ENTRYPOINT ["uvicorn", "protmpnn.api:app", "--host", "0.0.0.0"]

Expose and --port can be added during docker run. Don't stick to it in Dockerfile

@@ -0,0 +1,29 @@
from __future__ import annotations

import dataclasses
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
import dataclasses
from pydantic.dataclasses import dataclass

Comment on lines 12 to 19
if os.path.exists(directory):
# Remove all files and subdirectories in the directory
for item in os.listdir(directory):
item_path = os.path.join(directory, item)
if os.path.isfile(item_path) or os.path.islink(item_path):
os.unlink(item_path) # Remove files and links
elif os.path.isdir(item_path):
shutil.rmtree(item_path) # Recursively remove subdirectories
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if os.path.exists(directory):
# Remove all files and subdirectories in the directory
for item in os.listdir(directory):
item_path = os.path.join(directory, item)
if os.path.isfile(item_path) or os.path.islink(item_path):
os.unlink(item_path) # Remove files and links
elif os.path.isdir(item_path):
shutil.rmtree(item_path) # Recursively remove subdirectories
shutil.rmtree(directory, ignore_errors=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants