title: How to use sqlite3 with docker compose
body: <p>Between the following tutorials;</p>
  
  <ul>
  <li><a href="https://mherman.org/blog/2017/12/07/dockerizing-a-react-app/" rel="noreferrer">Dockerizing create-react-app</a></li>
  <li><a href="https://mherman.org/blog/2017/05/11/developing-microservices-node-react-docker/#web-service---part-1" rel="noreferrer">Developing microservices - Node, react &amp; docker</a></li>
  </ul>
  
  <p>I have been able to convert my nodejs app to dockerized micro-services which is up and running and connecting to services. However, my app uses Sqlite/Sequelize and this was working perfectly prior to dockerizing.</p>
  
  <p>With the new setup, I get error;</p>
  
  <pre><code>/usr/src/app/node_modules/sequelize/lib/dialects/sqlite/connection-manager.js:31
  throw new Error('Please install sqlite3 package manually');
  Error: Please install sqlite3 package manually at new ConnectionManager 
  (/usr/src/app/node_modules/sequelize/lib/dialects/sqlite/connection-manager.js:31:15)
  </code></pre>
  
  <p>My question is;</p>
  
  <ol>
  <li>Is it possible to use Sqlite3 with Docker</li>
  <li>If so, anyone able to share sample docker-compose.yml and Dockerfile combo that works for this please.</li>
  </ol>
  
  <p><strong><em>My docker-compose.yml</em></strong></p>
  
  <pre><code>version: '3.5'
  
  services:
    user-service:
      container_name: user-service
      build: ./services/user/
      volumes:
        - './services/user:/usr/src/app'
        - './services/user/package.json:/usr/src/package.json'
      ports:
        - '9000:9000' # expose ports - HOST:CONTAINER
  
    web-service:
      container_name: web-service
      build:
        context: ./services/web
        dockerfile: Dockerfile
      volumes:
        - './services/web:/usr/src/app'
        - '/usr/src/app/node_modules'
      ports:
        - '3000:3000' # expose ports - HOST:CONTAINER
      environment:
        - NODE_ENV=development
      depends_on:
        - user-service
  </code></pre>
  
  <p><strong><em>My user/ Dockerfile</em></strong></p>
  
  <pre><code>FROM node:latest
  
  # set working directory
  RUN mkdir /usr/src/app
  WORKDIR /usr/src/app
  
  # add `/usr/src/node_modules/.bin` to $PATH
  ENV PATH /usr/src/app/node_modules/.bin:$PATH
  
  # install and cache app dependencies
  ADD package.json /usr/src/package.json
  RUN npm install
  
  # start app
  CMD ["npm", "start"]
  </code></pre>
  
  <p><strong><em>My web/ Dockerfile</em></strong></p>
  
  <pre><code>FROM node:latest
  
  # set working directory
  RUN mkdir /usr/src/app
  WORKDIR /usr/src/app
  
  # add `/usr/src/app/node_modules/.bin` to $PATH
  ENV PATH /usr/src/app/node_modules/.bin:$PATH
  
  # install and cache app dependencies
  COPY package.json /usr/src/app/package.json
  RUN npm install
  RUN npm install react-scripts@1.1.4
  RUN npm install gulp -g
  
  # start app
  CMD ["npm", "start"]
  </code></pre>
  
  <p>Many thanks. </p>