Skip to content

Latest commit

 

History

History
87 lines (68 loc) · 2.41 KB

README.md

File metadata and controls

87 lines (68 loc) · 2.41 KB

Corpora DevContainer

This DevContainer setup provides a development environment with Docker Compose, Python 3.12, PostgreSQL, Rust, and zsh.

Features

  • Python 3.12 with dependencies from requirements.txt
  • PostgreSQL service with configurable environment variables
  • Rust/Cargo integrated for additional development
  • VS Code Customizations for Python linting, formatting, and Docker integration

Prerequisites

  • Docker
  • Visual Studio Code

Quick Setup

  1. Clone the Repository:

    git clone https://github.com/skyl/corpora.git
    cd corpora
  2. Create .env from Example:

    • Copy .env.example to .env:

      cp .env.example .env
  3. Open in VS Code:

    • Open the corpora folder in VS Code.
    • Ensure Docker is running.
  4. Build & Connect in DevContainer:

    • Reopen the folder in a container:
      • Open Command Palette (Cmd+Shift+P or Ctrl+Shift+P).
      • Run Remote-Containers: Reopen in Container.
  5. Environment Configuration:

    • Set API keys and credentials in .env:

      OPENAI_API_KEY=""
      CORPORA_CLIENT_ID=""
      CORPORA_CLIENT_SECRET=""
      GITHUB_TOKEN=""
      
  6. Post-Setup Commands:

    • Run server initialization:

      cd py/packages/corpora_proj
      ./manage.py migrate
      ./manage.py createsuperuser
    • Open your host browser and go to localhost:8877/admin/.

      • Log in with your superuser account.
      • Create an OAuth application:
        • URL: http://localhost:8877/admin/oauth2_provider/application/add/
        • Choose Confidential and Client credentials
        • Add your superuser as the owner of the application
        • Update .env file with CORPORA_CLIENT_ID and CORPORA_CLIENT_SECRET.
  7. Rebuild DevContainer:

    • Reload to apply .env changes.

Usage Example

With .env configured and the devcontainer running, use CLI commands:

corpora corpus init
corpora corpus sync
corpora workon file README.md
corpora plan issue

Ports

  • App: 8877

Notes

  • Variations in Docker setup can be found in ../docker-compose.yaml and ../docker/README.md.
  • To run without VS Code, use Docker Compose directly.
  • The directory sets up Docker and Compose for VS Code integration.
  • Contains README.md, devcontainer.json, setup.sh.
  • Interactive container includes Rust/Cargo, full Python/Django/Postgres setup, with zsh.