-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (37 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
43 lines (37 loc) · 1.09 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
43
# Stage 1: Build Next.js static export
FROM node:22-alpine AS frontend
RUN corepack enable
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY src/ ./src/
COPY public/ ./public/
COPY next.config.ts tsconfig.json postcss.config.mjs components.json ./
RUN pnpm build
# Stage 2: Build Rust server binary
FROM rust:slim-bookworm AS backend
RUN apt-get update && apt-get install -y pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
WORKDIR /app/src-tauri
COPY src-tauri/ ./
RUN cargo build --release --bin codeg-server --no-default-features
# Stage 3: Runtime
FROM node:22-bookworm-slim
RUN apt-get update && apt-get install -y \
libsqlite3-0 \
git \
openssh-client \
ca-certificates \
curl \
python3 \
python3-pip \
&& rm -rf /var/lib/apt/lists/*
COPY --from=backend /app/src-tauri/target/release/codeg-server /usr/local/bin/codeg-server
COPY --from=frontend /app/out /app/web
ENV CODEG_STATIC_DIR=/app/web
ENV CODEG_DATA_DIR=/data
ENV CODEG_PORT=3080
ENV CODEG_HOST=0.0.0.0
ENV SHELL=/bin/bash
EXPOSE 3080
VOLUME /data
CMD ["codeg-server"]