All Projects → dannav → now-compose

dannav / now-compose

Licence: MIT license
Docker compose for zeit now. [deprecated]

Programming Languages

javascript
184084 projects - #8 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to now-compose

now-nuxt
A Now v2 Nuxt builder
Stars: ✭ 25 (-68.75%)
Mutual labels:  now, zeit
Temps
λ A selfhostable serverless function runtime. Inspired by zeit now.
Stars: ✭ 15 (-81.25%)
Mutual labels:  now, zeit
Micro Medium Api
Microservice for fetching the latest posts of Medium with GraphQL.
Stars: ✭ 138 (+72.5%)
Mutual labels:  now, zeit
micro-unfurl
Small microservice that unfurls a URL and returns the OpenGraph meta data
Stars: ✭ 28 (-65%)
Mutual labels:  now, zeit
now-custom-runtime
ZEIT Now v2.0 builder for custom AWS Lambda runtimes
Stars: ✭ 21 (-73.75%)
Mutual labels:  now, zeit
Nextjs Vercel Firebase
Next.js app using API routes to connect with Firestore.
Stars: ✭ 133 (+66.25%)
Mutual labels:  now, zeit
Vercel Rust
Community based builder for using rust on the now/zeit platform
Stars: ✭ 168 (+110%)
Mutual labels:  now, zeit
Now Storage
Use Now static deployments to upload and store files.
Stars: ✭ 91 (+13.75%)
Mutual labels:  now, zeit
now-travis
No description or website provided.
Stars: ✭ 50 (-37.5%)
Mutual labels:  now, zeit
Now Env
Use `now.json` environment variables while developing
Stars: ✭ 219 (+173.75%)
Mutual labels:  now, zeit
Stage Ci
Automatic deploy previews for your PRs using zeit.co/now.
Stars: ✭ 132 (+65%)
Mutual labels:  now, zeit
now-swift-example
Example for use Kitura framework and swift lang with https://zeit.co/now.
Stars: ✭ 18 (-77.5%)
Mutual labels:  now, zeit
Deploy.now
One click deploys to △ now
Stars: ✭ 121 (+51.25%)
Mutual labels:  now, zeit
Create React App Now
Hello, create-react-app, meet Zeit's awesome now.sh service.
Stars: ✭ 137 (+71.25%)
Mutual labels:  now, zeit
Now Logs
realtime logging for now - https://logs.now.sh
Stars: ✭ 103 (+28.75%)
Mutual labels:  now, zeit
Now Pipeline
Simple CI pipeline with goal to deploy new version at Zeit Now cloud if tests pass
Stars: ✭ 143 (+78.75%)
Mutual labels:  now, zeit
Jwt Example
Playing with user registration, login/logout, auth, etc using JWTs, serverless functions & faunadb as the data store.
Stars: ✭ 22 (-72.5%)
Mutual labels:  now, zeit
Now Clear
A utility to delete all zeit now instances that aren't aliased
Stars: ✭ 12 (-85%)
Mutual labels:  now, zeit
Now Client
A JavaScript wrapper for the Now Instant API
Stars: ✭ 199 (+148.75%)
Mutual labels:  now, zeit
myethereumapp
Web client for viewing data from the Etherscan API
Stars: ✭ 18 (-77.5%)
Mutual labels:  now, zeit

now has fundamentally changed as of 2.0 so development of this project has stopped. Please read the now release here for more info. Thanks for everyone who has tried this out!


now-compose

CircleCI

now-compose is a command line interface for developing and deploying applications with docker-compose for zeit now.

Setup

now-compose behaves as a wrapper around docker-compose. To get started, you will need docker and docker-compose setup on your machine. To install these dependencies visit the docker-compose install guide.

Install now-compose:

npm i -g now-compose

now-compose is also available as an executable. Check the releases to find one for your system. You will then want to move that executable to a folder in your PATH environment variable to use from the command line.

Usage

If you're already working on a project using docker-compose you can tell now-compose to use your docker-compose.yml file with the -f flag. Otherwise, rename docker-compose.yml to now-compose.yml. now-compose only supports the docker-compose version 3 config syntax. You can learn more about the syntax at the config reference here if you need to upgrade.

By default, now-compose will look for a now-compose.yml file in the current working directory.

You can then use now-compose as you would use docker-compose. For instance, in a directory with a now-compose.yml file run the following to start all containers defined in your config:

now-compose up -d

or if you want to use a docker-compose.yml file

now-compose -f docker-compose.yml up -d

You can view other commands that now-compose supports by running:

now-compose --help

Example project

To view an example project built with now-compose take a look at the cluster example.

Differences when developing with now-compose compared to docker-compose

There are a couple of small differences to keep in mind when using now-compose vs docker-compose.

The first is networking between containers. Usually for services defined in a docker-compose.yml file you would make requests to another service by requesting a url that has the service's name in the url.

version: "3"
services:
  web:
    build: ./web
    links:
      - api
    ports:
      - 3000:3000
  api:
    build: ./api
    ports:
      - 3001:3001

i.e. in the above example web can make a request to api by requesting http://api. now-compose will handle this for you, however you will want to reference the urls defined in environment variables that now-compose will provide to your application.

Environment Var Description Example
NOW_HOST_<NAME> The url of the service NOW_HOST_API
NOW_PORT_<NAME> The first port defined in your services ports config property NOW_PORT_API

The second difference from docker-compose, is that all services defined in now-compose.yml must have a build property defined that points to the location of that service's Dockerfile. Since a Dockerfile must be defined for deployments to zeit now. Any services that do not contain a build property (i.e. reference a docker image) will run locally, but they will be skipped during deployment.

This allows you to setup a database locally for development purposes. But skip the deployment to zeit now.


The third difference is that service names defined in now-compose.yml must not contain special characters. Only letters, digits and '_' are allowed.

Deploying to zeit now

Before you can deploy a project using now-compose to zeit now, you need to provide an API token generated to make requests to the now API on behalf of your account.

Visit the token creation screen and generate a new one for use by now-compose.

You can then deploy your application with:

now-compose deploy --apiKey=<your api token>

You can also provide now-compose an api token by setting the environment variable NOW_API_KEY with the value of your token.

Deployment order

A deployment will be created for each service defined in now-compose.yml in order of the depends_on property set for each service in now-compose.yml.

Any services that are linked (using the "links" property in your application's config) will have the environment variables NOW_HOST_<SERVICENAME> set to the deployment url of linked services. NOW_PORT_<SERVICENAME> will be 443 since zeit only serves requests over https.

Happy Developing 🎉

Contributing

All contributions are welcome.

  • Fork this repository to your own GitHub account and then clone it to your local device.
  • Uninstall now-compose if it's already installed: npm uninstall -g now-compose
  • Link it to the global module directory: npm link

Roadmap

now-compose is still a work in progress and is considered in an "experimental" phase. However, don't let that deter you from actually using it. Once the codebase matures expect support for static and Node.js projects for local development and deployment.

Author

Danny Navarro (@danny_nav)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].