-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (20 loc) · 597 Bytes
/
Copy pathDockerfile
File metadata and controls
25 lines (20 loc) · 597 Bytes
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
# Use single stage to keep all source and build tools
FROM rust:1.84
# Install build dependencies
RUN apt-get update && apt-get install -y \
clang \
llvm-dev \
gcc \
g++ \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Set up working directory
WORKDIR /usr/src/app
# Copy source code
COPY . .
# Create non-root user
RUN useradd -m user && \
chown -R user:user /usr/src/app
USER user
# Build command - this will run every time the container starts
CMD ["sh", "-c", "cd helix-container && RUSTFLAGS='' cargo build --release && ../target/release/helix-container"]