diff --git a/Dockerfile b/Dockerfile index e69de29..4e7091f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 yarn@0.27.5 + +### Add bower +RUN npm install -g bower@1.8.0 + +### Add gulp +RUN npm install -g gulp@3.9.1 \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ab7c708 --- /dev/null +++ b/LICENSE @@ -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. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..26d944d --- /dev/null +++ b/README.md @@ -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 . +``` + +#### Run the Docker image and map port +```shell +docker run -p : +``` + +### 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:/` + +## License +[MIT](/LICENSE) \ No newline at end of file diff --git a/examples/basic/.dockerignore b/examples/basic/.dockerignore new file mode 100644 index 0000000..bdd9265 --- /dev/null +++ b/examples/basic/.dockerignore @@ -0,0 +1,6 @@ +# Don't copy those directories and files to Docker container +node_modules +npm-debug.log +README.md +.gitignore +dist \ No newline at end of file diff --git a/examples/basic/Dockerfile b/examples/basic/Dockerfile new file mode 100644 index 0000000..7fea474 --- /dev/null +++ b/examples/basic/Dockerfile @@ -0,0 +1,18 @@ +# Use this runtime as a parent image +FROM danautilus/web-linux: + +# 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 + +# Build and run the app +CMD npm start \ No newline at end of file diff --git a/examples/docker-compose/.dockerignore b/examples/docker-compose/.dockerignore new file mode 100644 index 0000000..bdd9265 --- /dev/null +++ b/examples/docker-compose/.dockerignore @@ -0,0 +1,6 @@ +# Don't copy those directories and files to Docker container +node_modules +npm-debug.log +README.md +.gitignore +dist \ No newline at end of file diff --git a/examples/docker-compose/Dockerfile b/examples/docker-compose/Dockerfile new file mode 100644 index 0000000..67606ae --- /dev/null +++ b/examples/docker-compose/Dockerfile @@ -0,0 +1,21 @@ +# Use danautilus/web-linux runtime as a parent image +FROM danautilus/web-linux:: + +# 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 + +# Build and run the app +CMD npm start \ No newline at end of file diff --git a/examples/docker-compose/docker-compose.yml b/examples/docker-compose/docker-compose.yml new file mode 100644 index 0000000..3ba7dac --- /dev/null +++ b/examples/docker-compose/docker-compose.yml @@ -0,0 +1,6 @@ +web-linux: + build: . + ports: + - ":" + volumes: + - .:/usr/src/app/:rw \ No newline at end of file