Skip to content

Instantly share code, notes, and snippets.

@toripiyo
Last active September 16, 2018 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toripiyo/3423025b676b6f81ba5f98fceb7b7478 to your computer and use it in GitHub Desktop.
Save toripiyo/3423025b676b6f81ba5f98fceb7b7478 to your computer and use it in GitHub Desktop.
create nodejs application development environment with docker
app
logs/*.log*
node_modules
version: '3.3'
services:
web:
build: .
command: heroku local development
volumes:
- ./app:/usr/src/app
ports:
- "5000:5000"
- "5858:5858"
depends_on:
- db
db:
image: "mongo:3.6"
ports:
- "27017:27017"
volumes:
- db:/data/db
volumes:
db:
FROM node:8
# install heroku
RUN curl https://cli-assets.heroku.com/install-ubuntu.sh | sh
# Create app directory
WORKDIR /usr/src
COPY package*.json ./
RUN npm install
# Bundle app source
COPY . .
EXPOSE 5000
EXPOSE 5858
CMD ["heroku", "local", "development"]
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach",
"type": "node",
"request": "attach",
"port": 5858,
"address": "localhost",
"restart": true,
"sourceMaps": false,
"outDir": null,
"localRoot": "${workspaceRoot}",
"remoteRoot": "/usr/src",
"restart": true
}
]
}
development: ./node_modules/.bin/forever -w -m 500 -c "node --inspect=0.0.0.0:5858" app/app.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment