Last active
September 16, 2018 05:17
-
-
Save toripiyo/3423025b676b6f81ba5f98fceb7b7478 to your computer and use it in GitHub Desktop.
create nodejs application development environment with docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app | |
logs/*.log* | |
node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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 | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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