Docker Integration Using Containers? We got your back. Start today using pm2-runtime, a perfect companion to get the most out of Node.js in production environment. The goal of pm2-runtime is to wrap your applications into a proper Node.js production environment. It solves major issues when running Node.js applications inside a container like: Second Process Fallback for High Application Reliabilit
以下に紹介するのは、 Docker を使って node.js 用のWebアプリケーションを開発、およびデプロイする際に、私が四苦八苦しながら学んだ秘訣やコツです。 このチュートリアル記事では、Dockerで socket.ioのチャットサンプル を白紙の状態から本番状態へとセットアップしていきます。このプロセスを通じて、そうした秘訣などを簡単に習得していただければ幸いです。特に、以下のような内容について見ていきます。 実際にDockerでNodeアプリケーションを起動する。 すべてをrootとして実行させない(悪いやり方です)。 開発時のテスト-編集-リロードサイクルを短くするため、バインドを使用する。 再構築を高速にするため、 node_modules をコンテナで管理する(これには秘訣があります)。 npm shrinkwrap で、ビルドを反復可能にする。 開発環境と本番環境で Do
$ cd ~/node_apps/sails-spike $ tree -L 2 . ├── Dockerfile ├── docker-compose.yml ├── package.json ├── pm2 │ ├── config │ └── log └── server ├── Gruntfile.js ├── README.md ├── api ├── app.js ├── assets ├── config ├── node_modules ├── package.json ├── tasks └── views DockerとDocker Compose Dockerfileは0.12/onbuildをベースイメージに使います。コンテナ内でsailsコマンドを実行するため、作業ユーザーと同じUIDでユーザーを作成します。マウントしたDockerホストのディレクトリ内で
こんにちは。Tokyo Otaku Mode(以下 TOM)ソフトウェアエンジニアの稲田です。 TOM が運営している otakumode.com は現在 1 日約 3、4 回ほどの頻度で更新されています。 これを多いと見るか少ないと見るかは人によって違うと思いますが、デプロイのたびにサイトにアクセスできない状態になっていては、まともなサイト運営とは言えないでしょう。 そこで、サイトへのアクセスを一瞬も止めることなくデプロイする、いわゆるホットデプロイと呼ばれるものが必要になります。 TOM ではアプリケーションサーバーに Node.js を使っており、既に Cluster モジュールを使った独自のホットデプロイの仕組みが実装されています。 今回はこのホットデプロイを Docker と Node.js でもできるようにしていきます。 Docker とは Docker, Inc.(旧 dot
CoffeeScriptで書いたアプリをDockerイメージとしてリリースする方法を説明します。Dockerを使うとNode.jsのインストールや依存関係の解決を手動でやる必要がなくなるので、他の環境でさくっとアプリを実行したい時に便利です。 以下の簡単なスクリプトを例に説明します。スクリプトの名前は app.coffee とします。 console.log 'hoge' スクリプトを実行するための package.json を作成します。この時、 npm start でスクリプトが実行されるようにします。 { "name": "example", "version": "1.0.0", "description": "CoffeeScript app example", "repository": { "type": "git", "url": "https://github.com/i
前回作成したKafkaクラスタをテストするために、簡単なNode.jsのproducerとconsumer用のコンテナを作成します。追加コンテナもKafkaとZooKeeperと同じdocker-compose.ymlに含めたかったのですが、うまく動かせませんでした。producerとconsumerのコンテナは通常のdocker runコマンドで起動することにします。 kafka-node Node.jsのKafkaクライアントはいくつかGitHubにあがっています。 kafka-node Prozess 今回のKafkaのバージョンは0.8.2.1です。Prozessは0.6のままので、0.8に対応しているkafka-nodを使うことにします。 プロジェクト 最初に作成したファイルのディレクトリ構造です。適当なディレクトリを作成します。 $ cd ~/docker_apps $ tre
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く