FROM debian:bullseye-slim # Install dependencies RUN apt-get update && apt-get install -y \ curl ca-certificates tar gzip libseccomp2 libssl1.1 git \ && rm -rf /var/lib/apt/lists/* # Create non-root user RUN useradd -ms /bin/bash coder USER coder ENV HOME=/home/coder WORKDIR /home/coder # Create bin directory for local binaries RUN mkdir -p /home/coder/.local/bin # Download and extract Coder binary (no dpkg/sudo) ENV CODER_VERSION=2.23.1 RUN curl -L "https://github.com/coder/coder/releases/download/v${CODER_VERSION}/coder_${CODER_VERSION}_linux_amd64.tar.gz" | tar -xz \ && mv coder /home/coder/.local/bin/coder \ && chmod +x /home/coder/.local/bin/coder ENV PATH="/home/coder/.local/bin:$PATH" # Expose Coder server port EXPOSE 3000 # Run Coder server on container start CMD ["coder", "server"]