title: Inside Docker container NetworkingError: connect ECONNREFUSED 127.0.0.1:8002
body: <p>I'm building up a nodejs app which is running in the docker container and getting following error</p>
  
  <blockquote>
    <p>NetworkingError: connect ECONNREFUSED 127.0.0.1:8000" </p>
  </blockquote>
  
  <p>And If I tried with <strong>dynamodb-local:8000</strong> then it will give me following error</p>
  
  <blockquote>
    <p>NetworkingError: write EPROTO
    140494555330368:error:1408F10B:SSLroutines:ssl3_get_record:wrong
    version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:252:</p>
  </blockquote>
  
  <p>I am using the following <strong>docker-compose.yml</strong></p>
  
  <pre><code>        version: "3"
  
          services:
          node_app:
              build: .
              container_name: 'node_app'
              restart: 'always'
              command: 'npm run start:local'
              ports:
              - "3146:3146"
              links:
              - dynamodb-local
          dynamodb-local:
              container_name: 'dynamodb-local'
              build: dynamodb-local/
              restart: 'always'
              ports:
              - "8000:8000"
  </code></pre>
  
  <p>Node js docker configuration as follows, <strong>node_app</strong></p>
  
  <pre><code>        FROM node:latest
  
          RUN mkdir -p /app/node_app
  
          WORKDIR /app/node_app
  
  
          # Install app dependencies
          COPY package.json /app/node_app
          #RUN npm cache clean --force &amp;&amp; npm install
          RUN npm install
  
  
          # Bundle app source
          COPY . /app/node_app
  
          # Build the built version
          EXPOSE 3146
          #RUN npm run dev
  
          CMD ["npm", "start"]
  </code></pre>
  
  <p>Dynamo DB local docker configuration as follows, <strong>dynamodb-local</strong></p>
  
  <pre><code>        #
          # Dockerfile for DynamoDB Local
          #
          # https://aws.amazon.com/blogs/aws/dynamodb-local-for-desktop-development/
          #
          FROM openjdk:7-jre
  
          RUN mkdir -p /var/dynamodb_local
          RUN mkdir -p /var/dynamodb_picstgraph
  
          # Create working space
          WORKDIR /var/dynamodb_picstgraph
  
          # Default port for DynamoDB Local
          EXPOSE 8000
  
          # Get the package from Amazon
          RUN wget -O /tmp/dynamodb_local_latest https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz &amp;&amp; \
              tar xfz /tmp/dynamodb_local_latest &amp;&amp; \
              rm -f /tmp/dynamodb_local_latest
  
          # Default command for image
          ENTRYPOINT ["/usr/bin/java", "-Djava.library.path=.", "-jar", "DynamoDBLocal.jar", "-sharedDb", "-dbPath", "/var/dynamodb_local"]
          CMD ["-port", "8000"]
  
          # Add VOLUMEs to allow backup of config, logs and databases
          VOLUME ["/var/dynamodb_local", "/var/dynamodb_nodeapp"]
  </code></pre>
  
  <p>But when I tried to connect outside docker container to local dynamodb and it will work perfectly.</p>
  
  <p>Please help me to sort out this issue.</p>