Skip to content

Instantly share code, notes, and snippets.

@iDVB
Created December 27, 2016 04:49
Show Gist options
  • Save iDVB/023c67ea02609c12989411ce89b152fe to your computer and use it in GitHub Desktop.
Save iDVB/023c67ea02609c12989411ce89b152fe to your computer and use it in GitHub Desktop.
build
database.sqlite
node_modules
ncp-debug.log
npm-debug.log
version: "2"
services:
web:
build: .
volumes:
- ./:/app
ports:
- "3000:3000"
- "3001:3001"
- "3002:3002"
command: >
sh -c '
if test -d node_modules;
then
echo node_modules_exists ;
else
cp -a /tmp/node_modules /app;
fi &&
yarn start
'
FROM node:7.2.1-alpine
# install all prerequisites
RUN apk add --no-cache make gcc g++ python
WORKDIR /tmp
COPY package.json /tmp
COPY yarn.lock /tmp
# Global install yarn package manager
RUN npm set progress=false && \
npm install -g --progress=false yarn && \
yarn install
WORKDIR /app
COPY ./ /app
RUN cp -a /tmp/node_modules /app/
CMD ["yarn", "start"]
EXPOSE 3000
EXPOSE 3001
EXPOSE 3002
EXPOSE 5000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment