forked from Fan-Pier-Labs/openrecord
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
101 lines (87 loc) · 4.98 KB
/
Copy pathDockerfile.dev
File metadata and controls
101 lines (87 loc) · 4.98 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
89
90
91
92
93
94
95
96
97
98
99
100
101
# Dev container: Ubuntu base, tooling installed in cached layers (no setup-script.sh at runtime).
# Multi-arch: amd64 and arm64 (Bun/Node/AWS/GH use arch detection; apt and pip support both).
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
# System packages + universe for wabt/binaryen (one layer)
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common \
&& add-apt-repository universe \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates curl wget gnupg lsb-release \
git git-lfs openssh-client rsync unzip zip xz-utils jq yq \
build-essential make cmake pkg-config autoconf automake libtool \
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev \
python3 python3-pip python3-venv python-is-python3 \
iputils-ping dnsutils net-tools traceroute tcpdump nmap \
htop psmisc lsof strace \
bash zsh fish vim nano \
postgresql-client less \
tzdata dnsutils locales \
docker.io docker-cli docker-compose socat \
sudo \
wabt binaryen \
&& rm -rf /var/lib/apt/lists/* \
&& sed -i '/en_US.UTF-8/s/^# //' /etc/locale.gen 2>/dev/null || true \
&& locale-gen en_US.UTF-8 2>/dev/null || true \
&& update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 2>/dev/null || true
ENV PATH="/usr/bin:$PATH"
RUN git lfs install 2>/dev/null || true
# Bun (install on Ubuntu; script puts it in /root/.bun)
RUN curl -fsSL https://bun.sh/install | bash \
&& echo 'export PATH="/usr/bin:$HOME/.bun/bin:$PATH"' >> /root/.bashrc \
&& mkdir -p /root/.config/fish \
&& (echo 'set -gx PATH /usr/bin $HOME/.bun/bin $PATH' >> /root/.config/fish/config.fish 2>/dev/null || true)
# Node.js (for npx; Bun is primary runtime)
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
# AWS CLI (architecture-aware)
RUN ARCH=$(dpkg --print-architecture) \
&& if [ "$ARCH" = "amd64" ]; then AWS_CLI_URL="https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"; \
elif [ "$ARCH" = "arm64" ]; then AWS_CLI_URL="https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip"; \
else echo "Unsupported architecture: $ARCH" && exit 1; fi \
&& curl "$AWS_CLI_URL" -o /tmp/awscliv2.zip \
&& unzip -q /tmp/awscliv2.zip -d /tmp \
&& /tmp/aws/install \
&& rm -rf /tmp/awscliv2.zip /tmp/aws
# GitHub CLI
RUN ARCH=$(dpkg --print-architecture) \
&& if [ "$ARCH" = "amd64" ]; then GH_ARCH="amd64"; elif [ "$ARCH" = "arm64" ]; then GH_ARCH="arm64"; else GH_ARCH=""; fi \
&& if [ -n "$GH_ARCH" ]; then \
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$GH_ARCH signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" > /etc/apt/sources.list.d/github-cli.list \
&& apt-get update -qq && apt-get install -y --no-install-recommends gh || true; \
fi \
&& rm -rf /var/lib/apt/lists/*
# Python: deploy scripts + image manipulation (PIL/Pillow, numpy, zstandard, opencv)
RUN pip3 install --no-cache-dir --break-system-packages \
pyyaml boto3 \
Pillow numpy zstandard \
opencv-python-headless \
&& (pip3 install --no-cache-dir --break-system-packages scikit-image 2>/dev/null || true)
# Fish as default shell + writable config (read-only mount workaround)
# Also load functions from ~/.config/fish/functions (mounted from host) so run.fish etc. work
RUN chsh -s /usr/bin/fish root 2>/dev/null || true \
&& mkdir -p /root/.local/config/fish /etc/fish/conf.d \
&& (test -d /root/.config/fish && test -n "$(ls -A /root/.config/fish 2>/dev/null)" && cp -r /root/.config/fish/* /root/.local/config/fish/ 2>/dev/null || true) || true \
&& echo 'set -gx fish_function_path $HOME/.config/fish/functions $fish_function_path' > /etc/fish/conf.d/99-config-fish-functions.fish \
&& echo 'export XDG_CONFIG_HOME=/root/.local/config' >> /root/.bashrc \
&& (echo 'export XDG_CONFIG_HOME=/root/.local/config' >> /root/.profile 2>/dev/null || true) || true \
&& echo 'set -gx PATH /usr/bin $HOME/.local/bin $PATH' >> /root/.local/config/fish/config.fish 2>/dev/null || true
# # Cursor Agent CLI
# RUN curl https://cursor.com/install -fsS | bash \
# && mkdir -p /root/.local/bin \
# && (test -f /root/.local/bin/cursor-agent && test ! -f /root/.local/bin/agent && ln -sf /root/.local/bin/cursor-agent /root/.local/bin/agent) || true \
# && echo 'export PATH="/usr/bin:$HOME/.local/bin:$PATH"' >> /root/.bashrc
# AWS profile + PATH for fish
ENV AWS_PROFILE=fanpierlabs
RUN echo 'export AWS_PROFILE=fanpierlabs' >> /root/.bashrc \
&& echo 'set -gx AWS_PROFILE fanpierlabs' >> /root/.local/config/fish/config.fish 2>/dev/null || true
ENV PATH="/root/.bun/bin:/root/.local/bin:$PATH"
WORKDIR /app
# Install deps (cached when package.json/bun.lock unchanged)
COPY package.json bun.lock ./
RUN bun install
COPY . .
CMD ["sleep", "infinity"]