Added dockerfile and dockerignore for local AI model.

This commit is contained in:
K
2025-07-22 16:43:31 +05:30
parent 3e93d8508b
commit f7c27d5a98
2 changed files with 48 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
archive/
bin/
Dockerfile
include/
leaf1.webp
lib/
lib64 -> lib/
node_modules/
package-lock.json
public/
pyvenv.cfg
samples/
share/
+35
View File
@@ -0,0 +1,35 @@
# Base image
FROM node:22
# Metadata
LABEL maintainer="kshitijka"
LABEL version=1.1.0
LABEL description="Crop Compass is a centralized management dashboard designed for farmers, enabling them to efficiently oversee their farms while leveraging advanced AI technology for disease identification and more."
# Update, upgrade + install python3+req
RUN apt update && apt upgrade -y && \
apt install -y python3 python3-pip python3.11-venv && \
apt clean all && rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd -s /bin/bash nonroot
# Create working directory
RUN mkdir -p /app
RUN chown -R nonroot:nonroot /app
WORKDIR /app
COPY . .
# Switch user
USER nonroot
# Setup virtual env and install stuff
RUN python3 -m venv /app
RUN /app/bin/pip install --no-cache-dir -r requirements.txt
ENV PATH="/app/bin:$PATH"
# Expose model port
EXPOSE 8081
# Run model
CMD ["node", "server.js"]