| FROM ghcr.io/0xarchit/apicortex-control-plane:latest AS cp_source |
| FROM ghcr.io/0xarchit/apicortex-ingest-service:latest AS ingest_source |
| FROM ghcr.io/0xarchit/apicortex-ml-service:latest AS ml_source |
| FROM ghcr.io/0xarchit/apicortex-api-testing:latest AS api_testing_source |
|
|
| FROM python:3.11-slim |
|
|
| RUN apt-get update && \ |
| apt-get install -y --no-install-recommends \ |
| libgomp1 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| WORKDIR /app |
|
|
| COPY --from=ingest_source /app/ingest-service /app/ingest-service/ingest-service |
| COPY --from=api_testing_source /app/api-testing /app/api-testing/api-testing |
|
|
| COPY --from=ml_source /opt/venv /opt/ml_venv |
| COPY --from=ml_source /app/app /app/ml-service/app |
| COPY --from=ml_source /app/workers /app/ml-service/workers |
| COPY --from=ml_source /app/model /app/ml-service/model |
|
|
| COPY --from=cp_source /opt/venv /opt/cp_venv |
| COPY --from=cp_source /app/app /app/control-plane/app |
|
|
| COPY entrypoint.sh /app/entrypoint.sh |
| RUN chmod +x /app/entrypoint.sh |
| COPY supervisord.conf /etc/supervisord.conf |
| COPY bin /app/bin |
| RUN chmod +x /app/bin/*.sh || true |
|
|
| ENV PORT=7860 |
| ENV INGEST_URL=http://localhost:8080 |
| ENV ML_SERVICE_URL=http://localhost:8001 |
| ENV API_TESTING_URL=http://localhost:9090 |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends supervisor && rm -rf /var/lib/apt/lists/* |
|
|
| RUN useradd -m -u 1000 appuser && \ |
| chown -R appuser:appuser /app |
| USER appuser |
|
|
| EXPOSE 7860 |
|
|
| ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"] |
|
|