0xarchit commited on
Commit
183e979
·
1 Parent(s): 9ebf41b

add test deploy file

Browse files
Files changed (3) hide show
  1. Dockerfile +37 -0
  2. README.md +0 -2
  3. entrypoint.sh +9 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
7
+ RUN apt-get update && \
8
+ apt-get install -y --no-install-recommends \
9
+ libgomp1 \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
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
18
+ COPY --from=ml_source /app/workers /app/ml-service/workers
19
+ COPY --from=ml_source /app/model /app/ml-service/model
20
+
21
+ COPY --from=cp_source /opt/venv /opt/cp_venv
22
+ COPY --from=cp_source /app/app /app/control-plane/app
23
+
24
+ COPY entrypoint.sh /app/entrypoint.sh
25
+ RUN chmod +x /app/entrypoint.sh
26
+
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
33
+ USER appuser
34
+
35
+ EXPOSE 7860
36
+
37
+ ENTRYPOINT ["/app/entrypoint.sh"]
README.md CHANGED
@@ -6,5 +6,3 @@ colorTo: indigo
6
  sdk: docker
7
  pinned: false
8
  ---
9
-
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
6
  sdk: docker
7
  pinned: false
8
  ---
 
 
entrypoint.sh ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ /app/ingest-service/ingest-service &
4
+
5
+ export PYTHONPATH=$PYTHONPATH:/app/ml-service
6
+ /opt/ml_venv/bin/python -m app.main &
7
+
8
+ export PYTHONPATH=$PYTHONPATH:/app/control-plane
9
+ exec /opt/cp_venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 7860