-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (31 loc) · 807 Bytes
/
Copy pathDockerfile
File metadata and controls
41 lines (31 loc) · 807 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Multi-stage build for Fortress development environment
FROM rust:1.75-slim
# Install build and runtime dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
build-essential \
ca-certificates \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user
RUN useradd -r -s /bin/bash fortress
# Set working directory
WORKDIR /app
# Copy Cargo files
COPY Cargo.toml Cargo.lock ./
COPY crates/ ./crates/
# Build all components
RUN cargo build --release
# Create data directory
RUN mkdir -p /data && chown fortress:fortress /data
# Switch to non-root user
USER fortress
# Set environment variables
ENV RUST_LOG=info
ENV FORTRESS_DATA_DIR=/data
# Expose server port
EXPOSE 8080
# Default to server
CMD ["./target/release/fortress-server"]