Skip to content

Instantly share code, notes, and snippets.

@rxon
Last active March 22, 2017 09:06
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 rxon/f7a7412956f606965e24e66a338f7393 to your computer and use it in GitHub Desktop.
Save rxon/f7a7412956f606965e24e66a338f7393 to your computer and use it in GitHub Desktop.
`npm i && docker-compose up` で mongodb + node on docker-compose on alpine 😎
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
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