-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile.dev
More file actions
88 lines (73 loc) · 2.95 KB
/
Copy pathDockerfile.dev
File metadata and controls
88 lines (73 loc) · 2.95 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Development Dockerfile for CodePrism
# Includes all development tools and dependencies for cloud development
FROM rust:1.82
# Install system dependencies
RUN apt-get update && apt-get install -y \
# Build essentials
pkg-config \
libssl-dev \
build-essential \
# Development tools
git \
curl \
wget \
vim \
nano \
# Optional: Node.js for JavaScript/TypeScript testing
nodejs \
npm \
# Optional: Python for Python testing
python3 \
python3-pip \
# Additional utilities
jq \
tree \
htop \
&& rm -rf /var/lib/apt/lists/*
# Install Rust development tools
RUN rustup component add rustfmt clippy rust-src
# Install additional Rust tools for development
RUN cargo install cargo-watch cargo-tree cargo-tarpaulin
# Set up development user (non-root)
RUN useradd -m -s /bin/bash dev && \
usermod -aG sudo dev && \
echo "dev ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# Create workspace directory
RUN mkdir -p /workspace && chown -R dev:dev /workspace
# Switch to development user
USER dev
WORKDIR /workspace
# Set up git configuration (can be overridden)
RUN git config --global user.name "CodePrism Developer" && \
git config --global user.email "dev@rustic-ai.dev" && \
git config --global init.defaultBranch main
# Environment variables for development
ENV RUST_LOG=debug
ENV CARGO_TARGET_DIR=/workspace/target
ENV REPOSITORY_PATH=/workspace
# Create useful aliases for development
RUN echo 'alias ll="ls -la"' >> ~/.bashrc && \
echo 'alias la="ls -la"' >> ~/.bashrc && \
echo 'alias ..="cd .."' >> ~/.bashrc && \
echo 'alias ...="cd ../.."' >> ~/.bashrc && \
echo 'alias codeprism-build="cargo build --release"' >> ~/.bashrc && \
echo 'alias codeprism-test="cargo test --all"' >> ~/.bashrc && \
echo 'alias codeprism-check="cargo check --all"' >> ~/.bashrc && \
echo 'alias codeprism-fmt="cargo fmt --all"' >> ~/.bashrc && \
echo 'alias codeprism-clippy="cargo clippy --all -- -D warnings"' >> ~/.bashrc
# Set up bash prompt with git branch info
RUN echo 'export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[01;33m\]\$(__git_ps1 \" (%s)\")\[\033[00m\]\$ "' >> ~/.bashrc
# Expose port for potential future HTTP interface
EXPOSE 8080
# Health check for development environment
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD cargo --version || exit 1
# Default command for development
CMD ["/bin/bash"]
# Labels for metadata
LABEL org.opencontainers.image.title="CodePrism Development Environment"
LABEL org.opencontainers.image.description="Development environment for 100% AI-generated CodePrism MCP server"
LABEL org.opencontainers.image.vendor="The Rustic Initiative"
LABEL org.opencontainers.image.licenses="MIT OR Apache-2.0"
LABEL org.opencontainers.image.source="https://github.com/rustic-ai /codeprism"
LABEL org.opencontainers.image.documentation="https://github.com/rustic-ai /codeprism/blob/main/README.md"