0xarchit commited on
Commit
906ca65
·
1 Parent(s): a693815

add api-testing microservice

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -0
  2. entrypoint.sh +7 -1
Dockerfile CHANGED
@@ -1,6 +1,7 @@
1
  FROM ghcr.io/0xarchit/apicortex-control-plane:latest AS cp_source
2
  FROM ghcr.io/0xarchit/apicortex-ingest-service:latest AS ingest_source
3
  FROM ghcr.io/0xarchit/apicortex-ml-service:latest AS ml_source
 
4
 
5
  FROM python:3.11-slim
6
 
@@ -12,6 +13,7 @@ RUN apt-get update && \
12
  WORKDIR /app
13
 
14
  COPY --from=ingest_source /app/ingest-service /app/ingest-service/ingest-service
 
15
 
16
  COPY --from=ml_source /opt/venv /opt/ml_venv
17
  COPY --from=ml_source /app/app /app/ml-service/app
@@ -27,6 +29,7 @@ RUN chmod +x /app/entrypoint.sh
27
  ENV PORT=7860
28
  ENV INGEST_URL=http://localhost:8080
29
  ENV ML_SERVICE_URL=http://localhost:8001
 
30
 
31
  RUN useradd -m -u 1000 appuser && \
32
  chown -R appuser:appuser /app
 
1
  FROM ghcr.io/0xarchit/apicortex-control-plane:latest AS cp_source
2
  FROM ghcr.io/0xarchit/apicortex-ingest-service:latest AS ingest_source
3
  FROM ghcr.io/0xarchit/apicortex-ml-service:latest AS ml_source
4
+ FROM ghcr.io/0xarchit/apicortex-api-testing:latest AS api_testing_source
5
 
6
  FROM python:3.11-slim
7
 
 
13
  WORKDIR /app
14
 
15
  COPY --from=ingest_source /app/ingest-service /app/ingest-service/ingest-service
16
+ COPY --from=api_testing_source /usr/local/bin/api-testing /app/api-testing/api-testing
17
 
18
  COPY --from=ml_source /opt/venv /opt/ml_venv
19
  COPY --from=ml_source /app/app /app/ml-service/app
 
29
  ENV PORT=7860
30
  ENV INGEST_URL=http://localhost:8080
31
  ENV ML_SERVICE_URL=http://localhost:8001
32
+ ENV API_TESTING_URL=http://localhost:9090
33
 
34
  RUN useradd -m -u 1000 appuser && \
35
  chown -R appuser:appuser /app
entrypoint.sh CHANGED
@@ -17,7 +17,13 @@ unset PYTHONPATH
17
  /opt/ml_venv/bin/python -m app.main
18
  ) &
19
 
20
- # 3. Start Control Plane (Python) on the public port 7860
 
 
 
 
 
 
21
  cd /app/control-plane
22
  export PYTHONPATH=/app/control-plane
23
  exec /opt/cp_venv/bin/python -m uvicorn app.main:app --host 0.0.0.0 --port 7860
 
17
  /opt/ml_venv/bin/python -m app.main
18
  ) &
19
 
20
+ # 3. Start API Testing Service (Rust) on a private port (9090)
21
+ (
22
+ export BIND_ADDR=127.0.0.1:9090
23
+ /app/api-testing/api-testing
24
+ ) &
25
+
26
+ # 4. Start Control Plane (Python) on the public port 7860
27
  cd /app/control-plane
28
  export PYTHONPATH=/app/control-plane
29
  exec /opt/cp_venv/bin/python -m uvicorn app.main:app --host 0.0.0.0 --port 7860