-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (31 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
38 lines (31 loc) · 1.06 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
FROM rust:1.85
RUN apt-get update && apt-get install -y \
git \
python3 \
curl \
perl \
&& rm -rf /var/lib/apt/lists/*
# GitHub CLI — download .deb directly via Docker ADD (Go HTTP, no OpenSSL/curl)
ADD https://github.com/cli/cli/releases/download/v2.68.0/gh_2.68.0_linux_amd64.deb /tmp/gh.deb
RUN dpkg -i /tmp/gh.deb && rm /tmp/gh.deb
RUN useradd -m -u 1000 -s /bin/bash axonix \
&& git config --global --add safe.directory /workspace \
&& git config --global user.email "axonix@axonix.live" \
&& git config --global user.name "Axonix"
WORKDIR /workspace
ENV CARGO_INCREMENTAL=0
# Cache dependencies before copying real source
COPY Cargo.toml Cargo.lock* ./
COPY vendor/ ./vendor/
RUN mkdir -p src src/bin \
&& echo 'fn main() {}' > src/main.rs \
&& echo 'fn main() {}' > src/bin/stream_server.rs \
&& cargo build \
&& rm -rf src \
target/debug/axonix \
target/debug/stream_server \
target/debug/deps/axonix-* \
target/debug/deps/stream_server-*
# Build the real project
COPY . .
RUN cargo build