Coder Social home page Coder Social logo

dev-container's Introduction

A work in progress development container for Apostrophe.

Build or update the container

On a new machine, or when you want the latest upstream packages in it, etc.:

./update

Start the container

./start

Open a shell in the container

./shell

You're in /persistent/workspace, a good place to git clone projects and get to work. This is part of a named volume, so as long as you don't delete all of your Docker volumes it should stick around, even if you rebuild the container.

Edit your code on the host

# You will be prompted for your password
./mount
cd ~/persistent
cd workspace
cd myproject
code .

The host sees the code via a Samba share that runs inside the container, which provides access to edit code without a heavy impact on performance inside the container. The use of Samba's unix extensions = yes feature allows chmod and friends to work normally even though this is traditionally a Windows file-sharing technology.

Access a website running in the container

http://localhost:3000/

If you don't like opening port 3000, you can change the update script to map a different host port.

Stop the container

./stop

Unmount the folder

sudo umount ~/persistent

TODO

  • Linux hosts. update should just use a bind mount in this situation, as it's already fast, and mount should do nothing and warn that it's not required.
  • Windows hosts. Use WSL 2, for sure. Probably mount a devfs URL. Not sure if unix extensions will prove compatible with that or not.
  • Developer experience. Forcing ~/persistent is rude and unintuitive, come up with a config file etc.

dev-container's People

Contributors

boutell avatar

Watchers

 avatar  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.