diff --git a/compose/dev/python/Dockerfile b/compose/dev/python/Dockerfile index c8e0b3c..8f085ce 100644 --- a/compose/dev/python/Dockerfile +++ b/compose/dev/python/Dockerfile @@ -20,14 +20,11 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* -COPY requirements.txt . -RUN pip install --no-cache-dir --requirement /requirements.txt +COPY requirements/* . +RUN pip install --no-cache-dir --requirement local.txt WORKDIR /app -RUN apt-get update && apt-get install --no-install-recommends -y \ - sudo git bash-completion nano ssh - COPY . . COPY --from=node /app/build ./build diff --git a/compose/prod/Dockerfile b/compose/prod/Dockerfile index 148508b..46d8834 100644 --- a/compose/prod/Dockerfile +++ b/compose/prod/Dockerfile @@ -2,18 +2,28 @@ FROM node:22-alpine AS node WORKDIR /app -LABEL org.opencontainers.image.source="TBC" -LABEL org.opencontainers.image.description="FYP Image" - COPY package*.json ./ RUN npm ci -COPY . . +COPY vite.config.ts . +COPY tsconfig.json . +COPY package*.json . +COPY src ./src +COPY index.html . RUN npm run build -FROM python:3.14.0-bookworm as python +FROM python:3.14.0-slim as python + +LABEL org.opencontainers.image.title="Dynavera - An Agentic Approach to Domain-Specific Trainers" +LABEL org.opencontainers.image.source="https://git.cs.bham.ac.uk/projects-2025-26/vxn217" +LABEL org.opencontainers.image.description="Dynavera (Final Year Project)" + +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 + +WORKDIR /app RUN apt-get update && apt-get install --no-install-recommends -y \ build-essential \ @@ -21,20 +31,18 @@ RUN apt-get update && apt-get install --no-install-recommends -y \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ && rm -rf /var/lib/apt/lists/* -COPY requirements.txt . -RUN pip install --no-cache-dir --requirement /requirements.txt +COPY requirements/* . +RUN pip install --no-cache-dir -r prod.txt -WORKDIR /app - -RUN apt-get update && apt-get install --no-install-recommends -y \ - sudo git bash-completion nano ssh - -COPY . . +COPY manage.py manage.py +COPY config config +COPY apps apps COPY --from=node /app/build ./build +RUN mkdir -p /app/static + COPY ./compose/prod/start /start -RUN sed -i 's/\r$//g' /start -RUN chmod +x /start +RUN sed -i 's/\r$//g' /start && chmod +x /start ENTRYPOINT ["/start"] \ No newline at end of file diff --git a/compose/prod/docker-compose.yml b/compose/prod/docker-compose.yml index 093de6e..5e0d8f3 100644 --- a/compose/prod/docker-compose.yml +++ b/compose/prod/docker-compose.yml @@ -16,6 +16,7 @@ services: - "traefik.http.routers.fyp-web.tls.certresolver=${CERTRESOLVER}" - "traefik.http.services.fyp-web.loadbalancer.server.port=${PORT}" - "com.centurylinklabs.watchtower.enable=true" + - "com.centurylinklabs.watchtower.scope=fyp" volumes: - ../../static:/app/static - ../../media:/app/media @@ -25,6 +26,7 @@ services: fyp-watchtower: image: containrrr/watchtower command: + - "--scope=fyp" - "--label-enable" - "--interval" - "30" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index f20b48e..0000000 --- a/requirements.txt +++ /dev/null @@ -1,197 +0,0 @@ -aiohappyeyeballs==2.6.1 -aiohttp==3.13.2 -aiosignal==1.4.0 -annotated-types==0.7.0 -anyio==4.11.0 -asgiref==3.10.0 -asttokens==3.0.0 -attrs==25.4.0 -backoff==2.2.1 -bcrypt==5.0.0 -beautifulsoup4==4.14.2 -brotli==1.2.0 -build==1.3.0 -cachetools==6.2.1 -certifi==2025.10.5 -charset-normalizer==3.4.4 -chromadb==1.3.5 -click==8.3.0 -colorama==0.4.6 -coloredlogs==15.0.1 -comm==0.2.3 -dataclasses-json==0.6.7 -ddgs==9.9.0 -debugpy==1.8.17 -decorator==5.2.1 -distro==1.9.0 -Django==5.2.8 -django-jazzmin==3.0.1 -djangorestframework==3.16.1 -docstring_parser==0.17.0 -docx==0.2.4 -duckdb==1.4.2 -duckduckgo_search==8.1.1 -durationpy==0.10 -executing==2.2.1 -filelock==3.20.0 -filetype==1.2.0 -flatbuffers==25.9.23 -frozenlist==1.8.0 -fsspec==2025.10.0 -google-ai-generativelanguage==0.9.0 -google-api-core==2.28.1 -google-auth==2.43.0 -google-cloud-aiplatform==1.71.1 -google-cloud-bigquery==3.38.0 -google-cloud-core==2.5.0 -google-cloud-resource-manager==1.15.0 -google-cloud-storage==2.19.0 -google-crc32c==1.7.1 -google-resumable-media==2.8.0 -googleapis-common-protos==1.72.0 -gpt4all==2.8.2 -greenlet==3.2.4 -grpc-google-iam-v1==0.14.3 -grpcio==1.76.0 -grpcio-status==1.71.2 -gunicorn==23.0.0 -h11==0.16.0 -h2==4.3.0 -hpack==4.1.0 -httpcore==1.0.9 -httptools==0.7.1 -httpx==0.28.1 -httpx-sse==0.4.3 -huggingface-hub==0.36.0 -humanfriendly==10.0 -hyperframe==6.1.0 -idna==3.11 -importlib_metadata==8.7.0 -importlib_resources==6.5.2 -ipykernel==7.1.0 -ipython==9.7.0 -ipython_pygments_lexers==1.1.1 -jedi==0.19.2 -Jinja2==3.1.6 -joblib==1.5.2 -jsonpatch==1.33 -jsonpointer==3.0.0 -jsonschema==4.25.1 -jsonschema-specifications==2025.9.1 -jupyter_client==8.6.3 -jupyter_core==5.9.1 -kubernetes==34.1.0 -langchain==1.0.5 -langchain-classic==1.0.0 -langchain-community==0.4.1 -langchain-core==1.0.4 -langchain-google-genai==3.0.1 -langchain-text-splitters==1.0.0 -langgraph==1.0.3 -langgraph-checkpoint==3.0.1 -langgraph-prebuilt==1.0.2 -langgraph-sdk==0.2.9 -langsmith==0.4.42 -lxml==6.0.2 -markdown-it-py==4.0.0 -MarkupSafe==3.0.3 -marshmallow==3.26.1 -matplotlib-inline==0.2.1 -mdurl==0.1.2 -mmh3==5.2.0 -mpmath==1.3.0 -multidict==6.7.0 -mypy_extensions==1.1.0 -nest-asyncio==1.6.0 -networkx==3.5 -numpy==2.3.4 -nvidia-cublas-cu11==11.11.3.6 -nvidia-cuda-runtime-cu11==11.8.89 -oauthlib==3.3.1 -onnxruntime==1.23.2 -opentelemetry-api==1.38.0 -opentelemetry-exporter-otlp-proto-common==1.38.0 -opentelemetry-exporter-otlp-proto-grpc==1.38.0 -opentelemetry-proto==1.38.0 -opentelemetry-sdk==1.38.0 -opentelemetry-semantic-conventions==0.59b0 -orjson==3.11.4 -ormsgpack==1.12.0 -overrides==7.7.0 -packaging==25.0 -parso==0.8.5 -pillow==12.0.0 -pip3-autoremove==2.0.1 -platformdirs==4.5.0 -posthog==5.4.0 -primp==0.15.0 -prompt_toolkit==3.0.52 -propcache==0.4.1 -proto-plus==1.26.1 -protobuf==5.29.5 -psutil==7.1.3 -pure_eval==0.2.3 -pyasn1==0.6.1 -pyasn1_modules==0.4.2 -pybase64==1.4.2 -pydantic==2.12.4 -pydantic-settings==2.11.0 -pydantic_core==2.41.5 -Pygments==2.19.2 -PyPika==0.48.9 -pyproject_hooks==1.2.0 -pyreadline3==3.5.4 -python-dateutil==2.9.0.post0 -python-docx==1.2.0 -python-dotenv==1.2.1 -PyYAML==6.0.3 -pyzmq==27.1.0 -referencing==0.37.0 -regex==2025.11.3 -requests==2.32.5 -requests-oauthlib==2.0.0 -requests-toolbelt==1.0.0 -rich==14.2.0 -rpds-py==0.29.0 -rsa==4.9.1 -safetensors==0.6.2 -scikit-learn==1.7.2 -scipy==1.16.3 -sentence-transformers==5.1.2 -setuptools==80.9.0 -shapely==2.1.2 -shellingham==1.5.4 -six==1.17.0 -sniffio==1.3.1 -socksio==1.0.0 -soupsieve==2.8 -SQLAlchemy==2.0.44 -sqlmodel==0.0.27 -sqlparse==0.5.3 -stack-data==0.6.3 -sympy==1.14.0 -tenacity==9.1.2 -threadpoolctl==3.6.0 -tokenizers==0.22.1 -torch==2.9.1 -tornado==6.5.2 -tqdm==4.67.1 -traitlets==5.14.3 -transformers==4.57.1 -typer==0.20.0 -typing-inspect==0.9.0 -typing-inspection==0.4.2 -typing_extensions==4.15.0 -tzdata==2025.2 -urllib3==2.3.0 -uvicorn==0.38.0 -vertexai==1.71.1 -watchfiles==1.1.1 -wcwidth==0.2.14 -websocket-client==1.9.0 -websockets==15.0.1 -whitenoise==6.11.0 -xxhash==3.6.0 -yarl==1.22.0 -zipp==3.23.0 -zstandard==0.25.0 diff --git a/requirements/base.txt b/requirements/base.txt new file mode 100644 index 0000000..aa622d8 --- /dev/null +++ b/requirements/base.txt @@ -0,0 +1,10 @@ +asgiref==3.10.0 +django==5.2.8 +djangorestframework==3.16.1 +django-jazzmin==3.0.1 +gunicorn==23.0.0 +jinja2==3.1.6 +python-dotenv==1.2.1 +requests==2.32.5 +sqlparse==0.5.3 +whitenoise==6.11.0 \ No newline at end of file diff --git a/requirements/local.txt b/requirements/local.txt new file mode 100644 index 0000000..46f8cab Binary files /dev/null and b/requirements/local.txt differ diff --git a/requirements/prod.txt b/requirements/prod.txt new file mode 100644 index 0000000..9c9dec9 --- /dev/null +++ b/requirements/prod.txt @@ -0,0 +1 @@ +-r base.txt \ No newline at end of file