FerretDB icon indicating copy to clipboard operation
FerretDB copied to clipboard

Support development inside Docker container (devcontainer, codespaces)

Open Copilot opened this issue 9 months ago • 1 comments

This PR adds support for development inside Docker containers via VSCode's devcontainers and GitHub Codespaces. These changes make it easier for new contributors to get started with FerretDB development without needing to install Go and other dependencies on their local machine.

Changes:

  • Added .devcontainer directory with configuration files:

    • devcontainer.json - Configuration for VSCode and GitHub Codespaces
    • Dockerfile - Container definition for the dev environment
    • setup.sh - Helper script for initial setup
    • README.md - Documentation for the devcontainer setup
  • Created docker-compose.devcontainer.yml to integrate the development container with existing PostgreSQL and MongoDB containers

  • Updated CONTRIBUTING.md to document both development approaches:

    • Traditional method (running FerretDB on host, dependencies in Docker)
    • Development container method (everything runs in containers)

These changes maintain the existing development workflow while adding an alternative that simplifies the setup for new contributors.

How to use:

  1. Clone the repository
  2. Open in VSCode with Remote Container extension installed
  3. VSCode will prompt to "Reopen in Container" or use Command Palette: "Remote-Containers: Reopen in Container"
  4. The development container will be built and started
  5. Use task commands as usual (task build-host, task run, etc.)

Alternatively, use GitHub Codespaces by clicking the "Code" button on the GitHub repository and selecting "Open with Codespaces".

Fixes #190.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot avatar May 27 '25 04:05 Copilot

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar May 27 '25 04:05 CLAassistant