Skip to content

Commit 1ce0244

Browse files
committed
Fix dockerfile
1 parent 24bcf8f commit 1ce0244

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

docker/cliproxyapi-exporter/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
FROM python:3.12-slim
22

3+
ENV PYTHONDONTWRITEBYTECODE=1 \
4+
PYTHONUNBUFFERED=1
5+
6+
RUN pip install --no-cache-dir requests prometheus-client
7+
38
WORKDIR /app
49

5-
COPY requirements.txt .
6-
RUN pip install --no-cache-dir -r requirements.txt
10+
RUN useradd -u 1000 -r -s /usr/sbin/nologin user && chown -R user:user /app
11+
USER user
712

813
COPY exporter.py .
914

envs/cliproxyapi/main.jsonnet

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ local networkPolicy = k.networking.v1.networkPolicy;
1717
},
1818
}),
1919

20+
cliproxyapi: dockerService.new('cliproxyapi', 'eceasy/cli-proxy-api', {
21+
namespace: 'cliproxyapi'
22+
ports: [9090],
23+
args: ['./CLIProxyAPI', '-config', '/data/config.yaml'],
24+
25+
pvs: {
26+
'/data': {
27+
name: 'cliproxyapi',
28+
size: '128Mi',
29+
},
30+
},
31+
}),
32+
2033
networkPolicy:
2134
networkPolicy.new('allow-cliproxyapi')
2235
+ networkPolicy.spec.podSelector.withMatchLabels({ 'app.kubernetes.io/name': 'cliproxyapi' })

0 commit comments

Comments
 (0)