File size: 1,486 Bytes
183e979
 
 
906ca65
183e979
 
 
 
 
 
 
 
 
 
 
7ad3718
183e979
 
 
 
 
 
 
 
 
 
 
080d8a1
 
 
183e979
 
 
 
906ca65
183e979
080d8a1
 
183e979
 
 
 
 
 
080d8a1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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"]