Last active
March 22, 2017 09:06
-
-
Save rxon/f7a7412956f606965e24e66a338f7393 to your computer and use it in GitHub Desktop.
`npm i && docker-compose up` γ§ mongodb + node on docker-compose on alpine π
This file contains 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
db: | |
image: mvertes/alpine-mongo:3.2.4-1 | |
volumes: | |
- /data/db | |
ports: | |
- '27017:27017' | |
web: | |
build: . | |
command: node_modules/.bin/nodemon app.js | |
environment: | |
NODE_ENV: 'development' | |
ports: | |
- '3000:3000' | |
volumes: | |
- .:/home/i/starter-app | |
- ./node_modules:/home/i/starter-app/node_modules | |
links: | |
- db:dockerized_mongo |
This file contains 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 mhart/alpine-node:7.7.4 | |
ENV HOME=/home/i | |
ENV APP=starter-app | |
RUN adduser -D -s /bin/false i | |
COPY package.json $HOME/$APP/ | |
RUN chown -R i:i $HOME/* | |
USER i | |
WORKDIR $HOME/$APP | |
RUN npm install | |
USER root | |
COPY . $HOME/$APP | |
RUN chown -R i:i $HOME/* | |
USER i | |
CMD ["node", "app.js"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment