<p>If you are open to try other things than IntelliJ, there is for example Eclipse Che which runs in container. Ideally there will be plugins for other components of your DevOps toolchains.</p>

CC BY-SA 3.0
2017-11-14T07:02:24.587Z
2017-11-14T07:02:24.587Z
Ta Mu
<p><br/> 
   There are several ways to achieve it, depend on which one, you like.<br/>
The most simple and easy is, get the docker image and create environment in it and save it for later, so when the member joins, you just need to start that image and whole environment is created 
FYI : <br/><a href="https://perchrunway.com/blog/2017-01-19-getting-started-with-docker-for-local-development" rel="nofollow noreferrer">Docker for dev</a><br/>
or<br/>
<a href="https://www.masterzendframework.com/docker-development-environment/" rel="nofollow noreferrer">Dev Environment</a>  </p>

<p>NOTE: These links are for PHP you need to figure out for other languages that you prefer.
Hope this helps</p>

CC BY-SA 3.0
2017-11-14T11:24:39.923Z
2017-11-14T11:24:39.923Z
Himanshu Phoolwar
<p>The onboarding experience should be almost as simple as telling your new developer to just clone the repo and run <code>docker-compose up</code>. Personally I wouldn't bother worrying about IDE integration because people might prefer to use different IDEs.</p>

<p>Every project/application (if you have multiple) should be able to run separately and each project/application should have it's own codebase. That's a concept from <a href="https://12factor.net/codebase" rel="noreferrer">The Twelve-Factor App</a> methodology.</p>

<p>In the root of each project add a <code>Dockerfile</code> and a <code>docker-compose.yml</code> file. </p>

<blockquote>
  <p>NOTE: I created <a href="https://codemason.io/docs/craft-kits" rel="noreferrer">Craft Kits</a> which you can use to automatically generate these files for the framework/language you're using with one command (e.g. <code>mason craft nodejs</code>), you don't even need to know Docker.</p>
</blockquote>

<p>The <code>Dockerfile</code> will build your application into an image, installing and dependencies your application needs to run. This image is the image that runs your app.</p>

<pre><code>FROM node:8.8-alpine

# Set our workdir
WORKDIR /app

# Install and cache app dependencies
COPY package.json /app
RUN npm install 

# Add project files
COPY . /app

# start app
CMD [ "npm", "start" ]
</code></pre>

<p>The <code>docker-compose.yml</code> file will spin up your environment. It will define all the services Docker should start for your application</p>

<pre><code>version: '2'
services:
  web:
    build: .
    volumes:
      - ./:/app
    ports:
      - "3000:3000"

  mongodb:
    image: mongodb
    volumes:
      - ./storage/data/mongodb:/data/db
    ports:
      - "27017:27017"
</code></pre>

<p>When you onboard a new developer, you can just tell them to <code>git clone</code> your repo and to fire up their development environment by running:  </p>

<pre><code>docker-compose up -d 
</code></pre>

<p>The advantage of this approach when you are developing locally, running <code>docker-compose up</code> will mount your code as a volume. </p>

<p>Then when you want to deploy, when you build your <code>Dockerfile</code> it will copy your code into your image so everything is packaged up nicely and easily moved around.</p>

<p>We use the same approach for apps on <a href="https://codemason.io" rel="noreferrer">Codemason</a>, my service for building, managing and scaling container-based applications. When you push new code, we automatically build an image from your Dockerfile. Since that image contains everything your app needs to run, it can be easily launched on any server and scaled up/down across multiple servers. </p>

CC BY-SA 3.0
2017-11-16T04:00:00.843Z
2017-11-16T04:00:00.843Z
bmagg
<p>Every time I onboard a new person on my team I have to go through the same routine of installing everything, figuring out what changed since last time we onboarded someone etc. Not fun.</p>

<p>I've heard about people maintaining docker containers with the development environment, but I'm not sure how to accomplish this.</p>

<p>Let's say you work on a repository containing a React webapp. Our IDE of choice is IntelliJ. It'd be cool if a new dev would just get a container with all the necessary dev stuff installed. </p>

<p>How do I make this happen?</p>

CC BY-SA 3.0
2017-11-13T23:31:41.180Z
Nearly the same way as with Virtual Machine. There are a lot of guides for creating a dev environment in a VM. Try to search Google/SO for that and ask more specific questions?
Jiri Klouda
CC BY-SA 3.0
2017-11-14T13:28:20.397Z
when you say you want a development environment, you mean you want the React app in the container. That's it? What specifically is "all the necessary dev stuff" you want installed?
bluescores
<docker><containers><toolchain>
Developing inside a Docker image?
langkilde
# Developing inside a Docker image?

(Asked by: username_0 on 2017-11-13)

Every time I onboard a new person on my team I have to go through the same routine of installing everything, figuring out what changed since last time we onboarded someone etc. Not fun.

I've heard about people maintaining docker containers with the development environment, but I'm not sure how to accomplish this.

Let's say you work on a repository containing a React webapp. Our IDE of choice is IntelliJ. It'd be cool if a new dev would just get a container with all the necessary dev stuff installed.

How do I make this happen?

**Tags:** docker, containers, toolchain

> **Comments:**
> **username_1**: Nearly the same way as with Virtual Machine. There are a lot of guides for creating a dev environment in a VM. Try to search Google/SO for that and ask more specific questions?  
> **username_2**: when you say you want a development environment, you mean you want the React app in the container. That's it? What specifically is "all the necessary dev stuff" you want installed?  

---

## 3 answers

### Answer by username_5 on 2017-11-16. Score: 8 | Accepted answer

The onboarding experience should be almost as simple as telling your new developer to just clone the repo and run docker-compose up. Personally I wouldn't bother worrying about IDE integration because people might prefer to use different IDEs.
Every project/application (if you have multiple) should be able to run separately and each project/application should have it's own codebase. That's a concept from The Twelve-Factor App methodology.
In the root of each project add a Dockerfile and a docker-compose.yml file. 

NOTE: I created Craft Kits which you can use to automatically generate these files for the framework/language you're using with one command (e.g. mason craft nodejs), you don't even need to know Docker.

The Dockerfile will build your application into an image, installing and dependencies your application needs to run. This image is the image that runs your app.
FROM node:8.8-alpine

# Set our workdir
WORKDIR /app

# Install and cache app dependencies
COPY package.json /app
RUN npm install 

# Add project files
COPY . /app

# start app
CMD [ "npm", "start" ]

The docker-compose.yml file will spin up your environment. It will define all the services Docker should start for your application
version: '2'
services:
  web:
    build: .
    volumes:
      - ./:/app
    ports:
      - "3000:3000"

  mongodb:
    image: mongodb
    volumes:
      - ./storage/data/mongodb:/data/db
    ports:
      - "27017:27017"

When you onboard a new developer, you can just tell them to git clone your repo and to fire up their development environment by running:  
docker-compose up -d 

The advantage of this approach when you are developing locally, running docker-compose up will mount your code as a volume. 
Then when you want to deploy, when you build your Dockerfile it will copy your code into your image so everything is packaged up nicely and easily moved around.
We use the same approach for apps on Codemason, my service for building, managing and scaling container-based applications. When you push new code, we automatically build an image from your Dockerfile. Since that image contains everything your app needs to run, it can be easily launched on any server and scaled up/down across multiple servers.


---

### Answer by username_3 on 2017-11-14. Score: 0

If you are open to try other things than IntelliJ, there is for example Eclipse Che which runs in container. Ideally there will be plugins for other components of your DevOps toolchains.


---

### Answer by username_4 on 2017-11-14. Score: 0

There are several ways to achieve it, depend on which one, you like.  
The most simple and easy is, get the docker image and create environment in it and save it for later, so when the member joins, you just need to start that image and whole environment is created
FYI :   
[Docker for dev](https://perchrunway.com/blog/2017-01-19-getting-started-with-docker-for-local-development)  
or  
[Dev Environment](https://www.masterzendframework.com/docker-development-environment/)

NOTE: These links are for PHP you need to figure out for other languages that you prefer.
Hope this helps


---

