Controllers added updated implementations and tests awaits
This commit is contained in:
25
ApiServices/Dockerfile
Normal file
25
ApiServices/Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /
|
||||
|
||||
# Install system dependencies and Poetry
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends gcc \
|
||||
&& rm -rf /var/lib/apt/lists/* && pip install --no-cache-dir poetry
|
||||
|
||||
# Copy Poetry configuration
|
||||
COPY /pyproject.toml ./pyproject.toml
|
||||
|
||||
# Configure Poetry and install dependencies with optimizations
|
||||
RUN poetry config virtualenvs.create false \
|
||||
&& poetry install --no-interaction --no-ansi --no-root --only main \
|
||||
&& pip cache purge && rm -rf ~/.cache/pypoetry
|
||||
|
||||
# Copy application code
|
||||
COPY /ApiServices .
|
||||
COPY /Controllers /Controllers
|
||||
|
||||
# Set Python path to include app directory
|
||||
ENV PYTHONPATH=/ PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
# Run the application using the configured uvicorn server
|
||||
CMD ["poetry", "run", "python", "app.py"]
|
||||
11
ApiServices/app.py
Normal file
11
ApiServices/app.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import time
|
||||
|
||||
from Controllers.Postgres.config import postgres_configs
|
||||
from Controllers.Mongo.config import mongo_configs
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
print(f"Hello from the Test Service {mongo_configs.url}")
|
||||
print(f"Hello from the Test Service {postgres_configs.url}")
|
||||
while True:
|
||||
time.sleep(10)
|
||||
Reference in New Issue
Block a user