-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (29 loc) · 1.19 KB
/
Copy pathDockerfile
File metadata and controls
42 lines (29 loc) · 1.19 KB
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
FROM node:22-bookworm-slim AS frontend
WORKDIR /ui
ARG NPM_REGISTRY=https://registry.npmmirror.com
COPY frontend/package*.json ./
RUN npm config set registry ${NPM_REGISTRY} \
&& npm ci --no-audit --no-fund
COPY frontend ./
RUN npm run build
FROM rust:1.86-slim AS gateway
RUN mkdir -p /usr/local/cargo \
&& printf '[source.crates-io]\nreplace-with = "rsproxy"\n\n[source.rsproxy]\nregistry = "sparse+https://rsproxy.cn/index/"\n\n[net]\ngit-fetch-with-cli = true\n' > /usr/local/cargo/config.toml
WORKDIR /gateway
COPY third_party/codex-app-transfer ./
RUN cargo build --release -p codex-gateway
FROM python:3.12-slim AS backend
ARG PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir --timeout 120 -i ${PIP_INDEX_URL} -r requirements.txt
COPY app ./app
COPY --from=frontend /ui/dist ./app/static
COPY --from=gateway /gateway/target/release/codex-gateway /usr/local/bin/codex-gateway
RUN mkdir -p /data /config/claude /config/codex /config/opencode \
&& chmod -R a+rX /app \
&& chmod a+rx /usr/local/bin/codex-gateway \
&& chmod -R 0777 /data /config
USER 1000:1000
EXPOSE 8787 18080
CMD ["python", "-m", "app.main"]