|
| 1 | +# Development container for Sourcebot |
| 2 | +# Based on Node.js 24 with TypeScript support |
| 3 | +FROM mcr.microsoft.com/devcontainers/typescript-node:24 |
| 4 | + |
| 5 | +ARG GO_VERSION=1.23.4 |
| 6 | +ARG CTAGS_VERSION=v6.1.0 |
| 7 | + |
| 8 | +# Install system dependencies |
| 9 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 10 | + # Build tools for universal-ctags |
| 11 | + autoconf \ |
| 12 | + automake \ |
| 13 | + pkg-config \ |
| 14 | + make \ |
| 15 | + gcc \ |
| 16 | + g++ \ |
| 17 | + libjansson-dev \ |
| 18 | + libyaml-dev \ |
| 19 | + libseccomp-dev \ |
| 20 | + libxml2-dev \ |
| 21 | + # PostgreSQL client tools (for debugging) |
| 22 | + postgresql-client \ |
| 23 | + # Redis CLI tools (for debugging) |
| 24 | + redis-tools \ |
| 25 | + # Other utilities |
| 26 | + curl \ |
| 27 | + git \ |
| 28 | + && rm -rf /var/lib/apt/lists/* |
| 29 | + |
| 30 | +# Install Go (detect architecture automatically) |
| 31 | +RUN ARCH=$(dpkg --print-architecture) && \ |
| 32 | + if [ "$ARCH" = "arm64" ]; then GOARCH="arm64"; else GOARCH="amd64"; fi && \ |
| 33 | + curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${GOARCH}.tar.gz" | tar -C /usr/local -xzf - |
| 34 | +ENV PATH="/usr/local/go/bin:${PATH}" |
| 35 | +ENV GOPATH="/home/node/go" |
| 36 | +ENV PATH="${GOPATH}/bin:${PATH}" |
| 37 | + |
| 38 | +# Build and install universal-ctags from source |
| 39 | +RUN git clone --depth 1 --branch "${CTAGS_VERSION}" https://github.com/universal-ctags/ctags.git /tmp/ctags \ |
| 40 | + && cd /tmp/ctags \ |
| 41 | + && ./autogen.sh \ |
| 42 | + && ./configure \ |
| 43 | + && make -j$(nproc) \ |
| 44 | + && make install \ |
| 45 | + && rm -rf /tmp/ctags |
| 46 | + |
| 47 | +# Enable corepack for Yarn and disable download prompts |
| 48 | +ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 |
| 49 | +RUN corepack enable |
| 50 | + |
| 51 | +# Create directories that will be mounted as volumes with correct ownership |
| 52 | +# This ensures the node user can write to them when volumes are mounted |
| 53 | +RUN mkdir -p /home/node/go /home/node/.yarn/berry/cache \ |
| 54 | + && chown -R node:node /home/node/go /home/node/.yarn |
| 55 | + |
| 56 | +# Set working directory |
| 57 | +WORKDIR /workspaces/sourcebot |
| 58 | + |
| 59 | +# Switch to non-root user |
| 60 | +USER node |
0 commit comments