docker-compose-nodejs-examples 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
docker-compose-nodejs-examples 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
docker-compose-nodejs-examples 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 MIT License
开发语言 JavaScript
操作系统 跨平台
软件类型 开源软件
所属分类 Web应用开发
开源组织
地区 不详
投 递 者 首席测试
适用人群 未知
收录时间 2021-11-30

软件简介

Getting started with Docker Compose and Nodejs

Heads up: Version 2.0 is coming! Read about its development here

https://medium.com/@b00giZm/building-the-next-version-of-compose-node-86eef3c23d5b

Motivation

Docker Compose is an awesome tool for creating isolated development environments with Docker by using simple configurations with YAML. It's clean and easy enough to wrap your head around, even if you are new to Docker. Even though, the official website is lacking some practial, real world examples for getting started with Docker Compose and Nodejs.

If you're like me, you are using a development server like nodemon that watches all your file changes and restarts your app accordingly. Bringing this workflow over to Docker Compose (née Fig) is a bit tricky. You can find many Github repositories that aim to show you how to do it, but not one (at least of the ones I found) of them are not suitable for "real world" development. Most of them even require you to rebuild your Dockerfile to reflect file changes - seriously?!

I hope the following real world examples will save you from some headache (like I had) while trying to figure out how to (pragmatically) use Docker Compose for your Nodejs apps.

Examples

Basic skeleton with Express app generator

https://github.com/b00giZm/docker-compose-nodejs-examples/tree/master/00-basic-express-generator

Express app with nodemon development server

https://github.com/b00giZm/docker-compose-nodejs-examples/tree/master/01-express-nodemon

Express app with Redis and nodemon development server

https://github.com/b00giZm/docker-compose-nodejs-examples/tree/master/02-express-redis-nodemon

Express app with Gulp.js build system

https://github.com/b00giZm/docker-compose-nodejs-examples/tree/master/03-express-gulp-watch

Express app with Grunt.js build system

https://github.com/b00giZm/docker-compose-nodejs-examples/tree/master/04-express-grunt-watch

Nginx, Express, Redis and nodemon

https://github.com/b00giZm/docker-compose-nodejs-examples/tree/master/05-nginx-express-redis-nodemon

More to come...

Maintainer

Pascal Cremer

License

The MIT License (MIT)

Copyright (c) 2014-2017 Pascal Cremer

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

展开阅读全文

代码

评论 (0)

加载中
更多评论
暂无内容
发表了博客
2018/09/04 15:33

es6 nodejs compose

const compose = (...fns) => { let len = fns.length; let fn_index = len - 1; let fn_result; function invoke(...args) { fn_result = len ? fns[fn_index].apply(this, args) : args[0] if(fn_index <= 0){ fn_index = len - 1; return fn_result; }else{ fn_index--; return invoke.call(null, fn_result); } } return invoke; } const compose2 = (...fns) => {...

0
0
发表了博客
2017/03/27 11:09

当Node.js遇见Docker

Node.js Best Practices - How to Become a Better Developer in 2017提到的几点,我们Fundebug深有同感: 使用ES6 使用Promise 使用LTS 使用Docker … 想必大家都知道ES6,Promise以及LTS,那Docker是啥玩意啊?翻遍Node文档也没见踪迹啊! GitHub仓库: Fundebug/nodejs-docker 什么是Docker? Docker是最流行的的容器工具,没有之一。本文并不打算深入介绍Docker,不过可以从几个简单的角度来理解Docker。 从进程的角度理解Docke...

0
0
发表于大前端专区
2020/08/13 17:57

用 Docker 打包 Node.js 程序

// 每日前端夜话 第378篇 // 正文共:1600 字 // 预计阅读时间:7 分钟 你听到过这样的对话吗? 程序猿1:在我的计算机上不能用 😒 程序猿2:在我这里好好的啊 🤨 这种对话很常见。这一般是由于工作环境设置或配置不同而引起的。这就是为什么要使用 docker 的主要目的。 在文中,我将教你什么是 docker,为什么使用以及怎样用来给 nodejs 程序打包。 什么是Docker? Docker 的定义为: ❝ Docker 是一个容器化平台,...

0
0
2020/07/22 19:37

docker和docker-compose

阅读文本大概需要3分钟。 docker、dockerfile与docker-compose区别 docker:和操作系统无关的一个沙箱容器,宿主机安装的什么操作系统和其本身无关,在它基础上可以制作各种系统类型的基础服务 Dockerfile:是把手工安装docer镜像的过程变成一个配置文件的方式运行,这样每次不需要一步步手敲命令去安装了,而只是需要一个配置文件运行既可生成一个镜像 docker-compos:提供了服务和项目的概念,这样一个服务可以配置多个项目,...

0
0
没有更多内容
加载失败,请刷新页面
点击加载更多
加载中
下一页
暂无内容
0 评论
0 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部