With the devcontainer-based setup, you won't need to (manually) install CodeHarbor and all dependencies on your local instance. Instead, a Docker setup containing all requirements will be configured.
You can either run a devcontainer locally (with Docker) or remotely (e.g., with GitHub Codespaces). In both cases, the development environment is defined in the .devcontainer
repository folder and will be applied when you open the project in a supported editor or IDE.
In order to run the devcontainer locally, you need to have Docker installed on your machine. You can find the installation instructions for your operating system on the official Docker website. Then, you'll need an editor or IDE that supports devcontainers. We recommend Visual Studio Code,RubyMine, IntelliJ IDEA.
You may either clone the repository via SSH (recommended) or HTTPS (hassle-free for read operations). If you haven't set up GitHub with your SSH key, you might follow their official guide.
SSH (recommended, requires initial setup):
git clone [email protected]:openHPI/codeharbor.git
HTTPS (easier for read operations):
git clone https://github.com/openHPI/codeharbor.git
Open the project in your editor or IDE to get started:
Visual Studio Code:
code codeharbor
RubyMine:
rubymine codeharbor
IntelliJ IDEA:
idea codeharbor
When you open the project in an supported editor or IDE, you'll be prompted to install the recommended extension(s) for support with devcontainers. Click on "Install" to install the recommended extensions.
After you've installed the recommended extension(s), you can start the devcontainer by a simple click.
Visual Studio Code: Click on the blue "Reopen in Container" button in the bottom right corner of your editor. More information.
RubyMine: / IntelliJ IDEA:
Open the file .devcontainer/devcontainer.json
and click on the blue Docker icon in the top left corner of your editor. More information for RubyMine or IntelliJ IDEA.
You can also run the devcontainer remotely with GitHub Codespaces. This way, you can develop CodeHarbor in the cloud without the need to install any dependencies on your local machine.
To get started with GitHub Codespaces, click on the "Open in GitHub Codespaces" button at the top of the README.md file. This will open the project in a new Codespace. You can find more information on how to set up your project for Codespaces in the official documentation.
When developing with the devcontainer, you can run CodeHarbor in the same way as you would on your local machine. The only difference is that you're running it inside the devcontainer. You can find more information on how to run CodeHarbor in the LOCAL_SETUP.md. All ports are forwarded to your local machine, so you can access CodeHarbor in your browser as usual.
In GitHub Codespaces, the ports are forwarded automatically, so you can access CodeHarbor in your browser by clicking on the "Open in Browser" button in the Codespaces environment as soon as the Rails server was started. More information.