![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
now-compose
Advanced tools
A command line interface for developing and deploying applications with docker-compose for zeit now.
now-compose
is a command line interface for developing and deploying applications with docker-compose for zeit now.
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
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 anow-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
To view an example project built with now-compose
take a look at the cluster example.
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.
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 variableNOW_API_KEY
with the value of your token.
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 🎉
All contributions are welcome.
now-compose
if it's already installed: npm uninstall -g now-compose
npm link
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.
Danny Navarro (@danny_nav)
FAQs
A command line interface for developing and deploying applications with docker-compose for zeit now.
The npm package now-compose receives a total of 1 weekly downloads. As such, now-compose popularity was classified as not popular.
We found that now-compose demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.