Skip to content

Commit b085128

Browse files
authored
Merge pull request #60 from modularcode/Dockerize
Dockerize tweaks
2 parents 97714df + 588be1f commit b085128

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#FROM ubuntu:16.04
2+
FROM node:alpine
3+
RUN mkdir -p /app
4+
COPY . /app
5+
WORKDIR /app
6+
ARG DEBIAN_FRONTEND=noninteractive
7+
8+
RUN apk update \
9+
&& apk upgrade \
10+
&& apk add --no-cache bash git openssh \
11+
&& npm install -g bower \
12+
&& npm install \
13+
&& chown -R node:node /app \
14+
&& npm rebuild node-sass \
15+
&& npm cache clean --force
16+
17+
USER node
18+
WORKDIR /app
19+
RUN bower install
20+
21+
EXPOSE 4000
22+
23+
CMD ["npm", "start"]
24+

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ AngularJS, Angular2, React and Meteor versions are coming soon.
4444

4545
* [Browser support](#browser-support)
4646
* [Development](#development)
47+
* [Docker](#docker)
4748
* [Folder structure](#folder-structure)
4849
* [File types](#file-types)
4950
* [Build tasks](#build-tasks)
@@ -61,6 +62,8 @@ AngularJS, Angular2, React and Meteor versions are coming soon.
6162
Some of the components use the new Flexbox Layout module which is available in most modern browsers. Bootstrap4 is used as main framework. Please make sure that it's suitable for you: [Flexbox browser support](http://caniuse.com/#feat=flexbox).
6263

6364
<br>
65+
66+
6467
## Development
6568

6669
For building the application, you need to have [NodeJs](https://nodejs.org/en/) with npm. You also need to have [Bower](http://bower.io/) installed globally.
@@ -91,6 +94,21 @@ Open the project [http://localhost:4000](http://localhost:4000).
9194

9295
> The project is built by Gulp. You can read more info in [Build Tasks](#build-tasks) section
9396
97+
## Running in Docker
98+
99+
To build the container, you need to install docker and docker-compose than launch the docker daemon.
100+
After launching the daemon run the following commands from the project folder:
101+
102+
Build the image
103+
```
104+
docker-compose build
105+
```
106+
107+
Launch the container
108+
```
109+
docker-compose up
110+
```
111+
94112
<br>
95113
## Folder Structure
96114

docker-compose.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: '3'
2+
3+
services:
4+
node:
5+
build:
6+
context: .
7+
volumes:
8+
- .:/app
9+
# http://jdlm.info/articles/2016/03/06/lessons-building-node-app-docker.html
10+
- /app/node_modules
11+
- /app/bower_components
12+
ports:
13+
# Expose container port.
14+
- "4000:4000"
15+

0 commit comments

Comments
 (0)