Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Docker: Development to Production

Docker: Development to Production

Introduction to Docker

Kelly Andrews

October 25, 2017
Tweet

More Decks by Kelly Andrews

Other Decks in Technology

Transcript

  1. FROM node:8.6.0-alpine WORKDIR /usr/app RUN apk update && apk add

    postgresql COPY package.json . RUN npm install --quiet COPY . . CMD ["npm", "start"]
  2. version: '3' services: web: build: . command: npm run dev

    volumes: - .:/usr/app/ - /usr/app/node_modules ports: - "3000:3000" depends_on: - postgres environment: DATABASE_URL: postgres://postgres@postgres postgres: image: postgres:9.6.2-alpine
  3. /> docker-compose up Building web Step 1/7 : FROM node:8.6.0-alpine

    ---> b7e15c83cdaf Step 2/7 : WORKDIR /usr/app ---> Using cache ---> 930841436abd Step 3/7 : RUN apk update && apk add postgresql ---> Using cache ---> 723796574582 Step 4/7 : COPY package.json . ---> ebf3d00f6e65 Removing intermediate container 47a5ab5f7e4c Step 5/7 : RUN npm install --quiet ---> Running in 4d0e1487b2dc
  4. web: build: dockerfile_path: Dockerfile image: registry.heroku.com/todos-js/web links: - postgres environment:

    DATABASE_URL: postgres://postgres@postgres cached: true postgres: image: postgres:9.6.2-alpine cached: true
  5. - type: parallel steps: - name: lint service: web command:

    npm run lint - name: tests service: web command: bin/ci "npm test -- --forceExit"
  6. /> jet steps (step: tests) (step: lint) (image: registry.heroku.com/todos-js/web) (service:

    web) (image: registry.heroku.com/todos-js/web) (service: web) Step 1/7 : FROM node:8.6.0-alpine (image: registry.heroku.com/todos-js/web) (service: web) ---> b7e15c83cdaf (image: registry.heroku.com/todos-js/web) (service: web) Step 2/7 : WORKDIR /usr/app (image: registry.heroku.com/todos-js/web) (service: web) ---> Using cache (image: registry.heroku.com/todos-js/web) (service: web) ---> 930841436abd (image: registry.heroku.com/todos-js/web) (service: web) Step 3/7 : RUN apk update && apk add postgresql (image: registry.heroku.com/todos-js/web) (service: web) ---> Using cache (image: registry.heroku.com/todos-js/web) (service: web) ---> 723796574582 (image: registry.heroku.com/todos-js/web) (service: web) Step 4/7 : COPY package.json . (image: registry.heroku.com/todos-js/web) (service: web) ---> Using cache (image: registry.heroku.com/todos-js/web) (service: web) ---> f4366f587688