GithubHelp home page GithubHelp logo

cyclonecode / container-talk Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 35 KB

Two containers communicating using sockets.

License: GNU General Public License v3.0

JavaScript 84.20% Dockerfile 15.80%
docker docker-compose node node-js nodejs socket server client server-client npm nvm

container-talk's Introduction

Container communication

An example of two containers running both a client and server, continuously sending ping and pong to each other.

Running

docker-compose build

Build service foo and bar.

docker-compose up -d

Start service foo and bar.

docker-compose log -f foo

Follow logs for service foo.

docker-compose log -f bar

Follow logs for service bar.

docker-compose down

Stop service foo and bar.

Shortcuts

For convenience there are a couple of npm scripts that can be used:

npm run build

Build service foo and bar.

npm run build -- --no-cache

Build service without using cache.

npm run logs:foo

Follow logs for service foo.

npm run logs:bar

Follow logs for service bar.

npm run exec:foo

Run a shell in foo.

npm run exec:bar

Run a shell in bar.

npm up

Start service foo and bar.

npm down

Stop service foo and bar.

Environment

Environment variables can be added to a .env file.

Name Description Example
FOO_PORT foo server port 2048
BAR_PORT bar server port 8000
WAIT delay between send 1500

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.