Skip to content

Commit 0fd6c0e

Browse files
kandrossomus
authored andcommitted
add docker support (#162)
* add docker support * add docker support for development * Typo * Bind host port 80 to containers 8000
1 parent f6d9ebc commit 0fd6c0e

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node
2+
MAINTAINER jaga santagostino <[email protected]>
3+
4+
RUN mkdir -p /usr/src/app
5+
WORKDIR /usr/src/app
6+
7+
COPY package.json /usr/src/app
8+
RUN npm install
9+
COPY . /usr/src/app
10+
11+
ENV NODE_ENV production
12+
13+
EXPOSE 8000
14+
CMD ["npm", "run", "bs"]
15+

Dockerfile-development

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node
2+
MAINTAINER jaga santagostino <[email protected]>
3+
4+
RUN mkdir -p /usr/src/app
5+
WORKDIR /usr/src/app
6+
7+
COPY package.json /usr/src/app
8+
RUN npm install
9+
COPY . /usr/src/app
10+
11+
ENV NODE_ENV development
12+
13+
EXPOSE 8000
14+
CMD ["npm", "start"]
15+

docker-compose-development.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
web:
2+
build: .
3+
dockerfile: Dockerfile-development
4+
links:
5+
- db
6+
ports:
7+
- "8000:8000"
8+
volumes:
9+
- .:/usr/src/app/
10+
environment:
11+
NOVE_ENV: development
12+
MONGO_URL: mongodb://db:27017/mern-starter
13+
db:
14+
image: mongo:latest
15+
ports:
16+
- "27017:27017"
17+

docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
web:
2+
build: .
3+
links:
4+
- db
5+
ports:
6+
- "80:8000"
7+
volumes:
8+
- .:/usr/src/app/
9+
environment:
10+
NODE_ENV: production
11+
MONGO_URL: mongodb://db:27017/mern-starter
12+
db:
13+
image: mongo:latest
14+
ports:
15+
- "27017:27017"
16+

0 commit comments

Comments
 (0)