Coder Social home page Coder Social logo

thissayantan / devcontainer-config Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 149 KB

This repository hosts a robust development environment encapsulated in a VS Code dev container, streamlined for web development projects. The container configuration is tailored to provide a seamless and consistent development experience across different environments, ensuring that your focus remains on coding.

License: MIT License

Dockerfile 48.99% Shell 44.25% HTML 6.76%
code-snippets containerized-dev-tools devcontainer docker environment-setup nodejs nvm oh-my-posh oh-my-zsh project-setup

devcontainer-config's Introduction

Web Development Container Development Environment

This development environment provides a fully configured workspace for web development projects.

Screenshots

Screenshot of the container running

Getting Started

  1. Install VS Code.
  2. Install Docker.
  3. Install the Remote - Containers extension in VS Code.
  4. Clone this repository to your local machine.
  5. Open the repository folder in VS Code.
  6. When prompted, click on "Reopen in Container". This will build the container and set up the environment as defined in the devcontainer.json file. If not prompted, you can open the command palette (Ctrl+Shift+P or Cmd+Shift+P on macOS), and type Reopen in Container.

Features

Container Configuration

The configuration for this dev container is found in the devcontainer.json file. This configuration includes:

  • Base image: mcr.microsoft.com/devcontainers/base:bookworm.
  • Node.js installed via a feature from the ghcr.io/devcontainers/features/node:1 repository.
  • Common utilities and zsh shell configuration via features from the ghcr.io/devcontainers/features/common-utils:2 and ghcr.io/devcontainers-contrib/features/zsh-plugins:0 repositories.
  • Local directory mount from host to container at /home/sayantan/.vscode-server-insiders.
  • Post creation script setup which installs various dependencies and configures the shell (see post-create.sh script below).

VS Code Extensions and Settings

A set of VS Code extensions are installed in the container by default. These extensions include:

  • ES7 React/Redux/GraphQL/React-Native snippets
  • Material Theme and Material Icon Theme
  • Cold Code
  • Prettier - Code Formatter
  • GitHub Actions and GitHub Copilot
  • Black (Python code formatter)
  • Python
  • Sort JSON
  • Code Spell Checker

Additional VS Code settings are also applied to provide a consistent editor configuration, such as:

  • Font family, size, and other editor preferences.
  • Emmet, Git, and terminal configurations.
  • Language-specific settings for JavaScript, TypeScript, HTML, CSS, JSON, and Python.
  • Theme and color customizations.

For a complete list of extensions and settings, refer to the devcontainer.json file.

Post Creation Script

The post-create.sh script runs after the container is built. This script:

  • Updates the system and installs prerequisites.
  • Installs pyenv and the latest version of Python.
  • Installs and configures Oh-My-Posh with a custom theme.

Usage

Once the container is built and running, you can start developing your web projects right away. The workspace is fully configured with a robust set of tools and utilities, making it easy to jump into coding.

The terminal in VS Code will open inside the container where you have access to all the tools and utilities installed in the container. You can also open a new terminal at any time using the Ctrl+ (backtick) orCmd+ (backtick) on macOS.

Your code files are also available within the container at the mounted directory, so you can edit files in VS Code on your local machine and run your code inside the container.

Accessing Services

If your development environment requires access to certain ports (e.g., for a web server), you can add the forwardPorts attribute to the devcontainer.json file to specify a list of ports to forward from the container to your local machine.

"forwardPorts": [3000, 5000]

Now, you can access the web server running inside the container at http://localhost:3000 and http://localhost:5000 on your local machine.

Customizing the Environment

The devcontainer.json and post-create.sh files provide a good starting point for customizing your development environment. You can modify these files to change the base image, install additional tools and utilities, configure the shell, and more.

You can also add new scripts, configuration files, and other assets to the .devcontainer directory to further customize the environment.

Troubleshooting

If you encounter any issues or have any questions about this dev container, you can check the documentation or GitHub repository for more information.

devcontainer-config's People

Contributors

thissayantan avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.