Skip to content

Commit

Permalink
Docker Dev Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Cruz committed Apr 21, 2019
1 parent 8f37d3c commit a58c806
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
@@ -0,0 +1,3 @@
node_modules
.dockerignore
Dockerfile-dev
18 changes: 18 additions & 0 deletions Dockerfile-dev
@@ -0,0 +1,18 @@
FROM node:latest

# set working directory
RUN mkdir /usr/src/app
WORKDIR /usr/src

# install and cache app dependencies
ADD package.json /usr/src/app/package.json
RUN npm install

# add `/usr/src/node_modules/.bin` to $PATH
ENV PATH /usr/src/node_modules/.bin:$PATH

# add app
COPY . /usr/src/app

# start app
CMD ["npm", "run", "dev]
30 changes: 30 additions & 0 deletions docker-compose-dev.yml
@@ -0,0 +1,30 @@
version: "2.1"

services:
app-db-dev:
container_name: app-db
image: mongo
ports:
- "27017:27017"
healthcheck:
test: exit 0

app-service-dev:
container_name: app
build:
context: ./
dockerfile: Dockerfile-dev
volumes:
- "./:/usr/src/app"
- "./package.json:/usr/src/package.json"
ports:
- "3000:3000"
environment:
- MONGO_URL="mongodb://app-db:27017/SampleDB"
- MONGO_URL_TEST="mongodb://app-db:27017/SampleDB"
- SESSION_SECRET="xxxxxxx"
links:
- app-db-dev
depends_on:
app-db-dev:
condition: service_healthy

0 comments on commit a58c806

Please sign in to comment.