| |
| |
| |
| FROM node:20-alpine AS frontend-build |
| WORKDIR /build/frontend |
|
|
| COPY frontend/package*.json ./ |
| RUN npm ci --frozen-lockfile |
|
|
| COPY frontend/ . |
| ENV NEXT_PUBLIC_API_URL="" |
| RUN npm run build |
|
|
| |
| |
| |
| FROM python:3.11-slim |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| nginx supervisor nodejs npm curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN useradd -m -u 1000 appuser |
|
|
| WORKDIR /app |
|
|
| |
| COPY backend/requirements.txt ./requirements.txt |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| ENV HF_HOME="/app/models" |
| ENV SENTENCE_TRANSFORMERS_HOME="/app/models" |
|
|
| |
| RUN python -c "\ |
| from sentence_transformers import SentenceTransformer; \ |
| from FlagEmbedding import FlagReranker; \ |
| SentenceTransformer('BAAI/bge-small-en-v1.5'); \ |
| FlagReranker('BAAI/bge-reranker-v2-m3', use_fp16=False); \ |
| print('All AI Models baked into Docker Image successfully!')" |
|
|
| |
| COPY backend/ /app/backend/ |
|
|
| |
| COPY --from=frontend-build /build/frontend/.next/standalone /app/frontend/ |
| COPY --from=frontend-build /build/frontend/.next/static /app/frontend/.next/static/ |
| COPY --from=frontend-build /build/frontend/public /app/frontend/public/ |
|
|
| |
| COPY nginx.conf /app/nginx.conf |
| COPY supervisord.conf /app/supervisord.conf |
|
|
| |
| RUN mkdir -p /tmp/nginx_client /tmp/nginx_proxy /tmp/nginx_fastcgi /tmp/nginx_uwsgi /tmp/nginx_scgi \ |
| && chown -R appuser:appuser /app /tmp \ |
| && chown -R appuser:appuser /var/lib/nginx /var/log/nginx 2>/dev/null || true \ |
| && chmod -R 755 /var/lib/nginx 2>/dev/null || true |
|
|
| |
| EXPOSE 7860 |
|
|
| USER 1000 |
|
|
| CMD ["/usr/bin/supervisord", "-c", "/app/supervisord.conf"] |
|
|