Coder Social home page Coder Social logo

reactdevcontainer's Introduction

React Dev Container

Ultimate React development container for Visual Studio Code

CI build

dockeri.co

Last Docker tag Latest size

Last release Last release size GitHub last release date Commits since release

GitHub last commit GitHub commit activity GitHub closed PRs GitHub issues GitHub closed issues

Visitors count

Features

  • Based on qmcgaw/basedevcontainer
    • Minimal custom terminal and packages
    • Nodejs, npm and yarn downloaded as Alpine packages
    • See more features
  • Globally installed: nodemon, create-react-app, mocha, and jest
  • Cross platform
    • Easily bind mount your SSH keys to use with git
    • Manage your host Docker from within the dev container, more details at qmcgaw/basedevcontainer
  • Extensible with docker-compose.yml
  • Two versions:
    1. Alpine 3.15 based
      • Image tags :latest, :alpine and :alpine-vx.x.x
      • Size of 260MB
      • โš ๏ธ does not work on arm64 due to vscode-remote-release#4462
    2. Debian Bullseye Slim based
      • Image tags :debian and :debian-vx.x.x
      • Size of 500MB
      • Not built for arm V6
  • Compatible with amd64, arm64, armv7, armv6, s390x and ppc64le

Requirements

Setup for a project

  1. Setup your configuration files
    • With style ๐Ÿ’ฏ

      docker run -it --rm -v "/yourrepopath:/repository" qmcgaw/devtainr:v0.2.0 -dev react -path /repository -name projectname

      Or use the built binary

    • Or manually: download this repository and put the .devcontainer directory in your project.

  2. If you have a .vscode/settings.json, eventually move the settings to .devcontainer/devcontainer.json in the "settings" section as .vscode/settings.json take precedence over the settings defined in .devcontainer/devcontainer.json.
  3. Open the command palette in Visual Studio Code (CTRL+SHIFT+P) and select Remote-Containers: Open Folder in Container... and choose your project directory
  4. If you want to use the Debian based image, you can modify the .devcontainer/Dockerfile in your directory.

Note that by default it will map the port 3000 to a random port on your host, which you can find with docker ps

Customization

See the .devcontainer/README.md document in your repository.

TODOs

License

This repository is under an MIT license unless indicated otherwise.

reactdevcontainer's People

Contributors

qdm12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

reactdevcontainer's Issues

Security Alert

Security Alert

Documentation: Alpine support for MacOS M1 with Visual Studio Code

Thanks for the amazing work.

Maybe consider adding a warning about using this container out of the box on Mac M1. Vscode has this outstanding issue:

microsoft/vscode-remote-release#4462

"Alpine Linux is not supported on the hardware architecture 'aarch64' of the container".

To work around I modified the qmcgaw/reactdevcontainer Dockerfile in the root dir to use debian:

(change base image and switch from apk to apt)

FROM qmcgaw/basedevcontainer:debian
ARG CREATED
ARG COMMIT
ARG VERSION=local
LABEL \
    org.opencontainers.image.authors="[email protected]" \
    org.opencontainers.image.created=$CREATED \
    org.opencontainers.image.version=$VERSION \
    org.opencontainers.image.revision=$COMMIT \
    org.opencontainers.image.url="https://github.com/qdm12/reactdevcontainer" \
    org.opencontainers.image.documentation="https://github.com/qdm12/reactdevcontainer" \
    org.opencontainers.image.source="https://github.com/qdm12/reactdevcontainer" \
    org.opencontainers.image.title="React Dev container Alpine" \
    org.opencontainers.image.description="React TS development container for Visual Studio Code Remote Containers development"
# Install Debian packages
ENV DEBIAN_FRONTEND noninteractive
RUN apt update && \
    apt install -y nodejs npm
RUN npm cache clean -f
RUN npm install -g n
RUN n stable
RUN npm install -g yarn
# Setup shells
COPY shell/.zshrc-specific shell/.welcome.sh /root/
# Sets directories for NPM global packages
ENV NODE_PATH="/root/.npm-packages/lib/node_modules" \
    MANPATH="/root/.npm-packages/share/man"
RUN echo "prefix = /root/.npm-packages" >> /root/.npmrc && \
    chmod 600 /root/.npmrc
ENV PATH=/root/.npm-packages/bin:$PATH
# Fix ownership and permissions of anonymous volume 'node_modules'
VOLUME [ "/workspace/node_modules" ]
RUN mkdir -p /workspace/node_modules && \
    chmod 700 /workspace/node_modules

And rebuilt it locally:

docker build -t qmcgaw/reactdevcontainer .

Please do let me know if there is a better workaround for now.

Python Dev Container?

Have you thought about creating a Python Dev Container? If not, why not? Or does Anaconda takes care of this? I find that Anaconda doesn't play nice with other python stuff, but I deal with it.

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.