Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Kleger committed Aug 22, 2017
2 parents 66fc5d1 + 202a2fb commit 3b01af4
Show file tree
Hide file tree
Showing 8 changed files with 176 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM debian:stretch

## Add linux dependencies

### Add sudo
RUN apt-get update
RUN apt-get install -y sudo
RUN rm -rf /var/lib/apt/lists/*

### Add curl
RUN apt-get update
RUN apt-get install -y curl

### Add bzip2
RUN apt-get install -y bzip2

### Add gnupg2
RUN apt-get install -y gnupg2

### Add Node.js 8.x
RUN curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
RUN apt-get install -y nodejs=8.4.0-1nodesource1~stretch1

## Add Node.js dependencies

### Add yarn
RUN npm install -g [email protected]

### Add bower
RUN npm install -g [email protected]

### Add gulp
RUN npm install -g [email protected]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2017 w3tecch

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Linux Docker Image for modern Web Development

> An easy way to set up your linux based web development environment with all necessary components.
## Table of contents
* [Included Components](#included-components)
* [Getting started](#getting-started)
* [How to use](#how-to-use)
* [Using Dockerfile only](#using-dockerfile-only)
* [Using Docker Compose](#using-docker-compose)
* [Using Docker Compose](#using-docker-compose)
* [Available Tags](#available-tags)
* [Access web app](#access-web-app)
* [License](#license)

## Included Components
Following Components are included in this docker image

| Component | Version | Description |
| ----------- | ----------- | ----------- |
| **Node.js** | 8.4.0 | JavaScript runtime built on Chrome's V8 JavaScript engine |
| **Yarn** | 0.27.5 | Fast, reliable, and secure dependency management for Node.js |
| **Bower** | 1.8.0 | A package manager for the web |
| **Gulp.js** | 3.9.1 | A JavaScript toolkit used as a streaming build system |

## Getting started
Before you start, make sure you have a recent version of [Docker](https://docs.docker.com/engine/installation/) installed

## How to use

### Using Dockerfile only
Get Dockerfile docs [here](https://docs.docker.com/glossary/?term=Dockerfile)

You can find some example files [here](/examples/basic)

#### Build the Docker image
```shell
docker build -t <image-name> .
```

#### Run the Docker image and map port
```shell
docker run -p <port-on-host>:<port-inside-docker-container> <image-name>
```

### Using Docker Compose
Compose is a tool for defining and running multi-container Docker applications. This is recommended for web development as you can use features like hot deployment and live reloading on your local machine

Get Docker Compose docs [here](https://docs.docker.com/compose/)

You can find some example files [here](examples/docker-compose)

### Available Tags
This are the available tags to use this runtime

| Tag | Description |
| ----------- | ----------- |
| **latest** | Use image build from master branch (recommended) |
| **beta** | Use image build from develop branch (experimental) |

### Access web app
Now you can access the web app using `http://localhost:<port-on-host>/`

## License
[MIT](/LICENSE)
6 changes: 6 additions & 0 deletions examples/basic/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Don't copy those directories and files to Docker container
node_modules
npm-debug.log
README.md
.gitignore
dist
18 changes: 18 additions & 0 deletions examples/basic/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Use this runtime as a parent image
FROM danautilus/web-linux:<tag>

# Create work directory
WORKDIR /usr/src/app

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

# Bundle app source to work directory
COPY . /usr/src/app

# Map port from container to the docker deamon
EXPOSE <port-inside-docker-container>

# Build and run the app
CMD npm start
6 changes: 6 additions & 0 deletions examples/docker-compose/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Don't copy those directories and files to Docker container
node_modules
npm-debug.log
README.md
.gitignore
dist
21 changes: 21 additions & 0 deletions examples/docker-compose/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Use danautilus/web-linux runtime as a parent image
FROM danautilus/web-linux::<tag>

# Create app work directory
WORKDIR /usr/src/app

# Remove old app dependencies
RUN rm -rf node_modules

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

# Bundle app source to work directory
COPY . /usr/src/app

# Map port to the docker deamon
EXPOSE <port-inside-docker-container>

# Build and run the app
CMD npm start
6 changes: 6 additions & 0 deletions examples/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
web-linux:
build: .
ports:
- "<port-on-host>:<port-inside-docker-container>"
volumes:
- .:/usr/src/app/:rw

0 comments on commit 3b01af4

Please sign in to comment.