Deploy from a Dockerfile
In this quick tutorial, you'll learn how to create and deploy a basic web server from a DockerFile.
Let's start from our ready-to-use project. Select your favorite web technology and
git clone the project.
Then go directly to the step 4 to prepare the deployment.
git clone https://github.com/ScaleDynamics/docker-node my-docker
Let's create manually your own
my-docker working directory, and follow the next steps
npm install express
Init a new HTTP server
Create a new
index.js file in the project directory, and copy-paste the following code into it:
Init a new Dockerfile
To use the SDK you need Node.js installed on your computer.
Look at https://nodejs.org/en/download/ (opens in a new tab) to install it.
To access our CLI, use
npx warp. To get installation options of the SDK, look to SDK installation.
You can have the list of available commands and help with
npx warp help
Then, create or update the
.dockerignore file as below to exclude the
node_modules folder from your deployment:
The deployment of a Docker container requires to indicate in which project and which environment you want to run it.
A project identifies a set of containers to be deployed. Users can use project to logically represents a website, a web app, a microservice, an API...
An environment defines the cloud execution environment to deploy and run a project. For example you can have 'pre-prod', 'demo', 'staging' or 'production' environments.
To access projects and deployment resources you need a ScaleDynamics account. You can sign up here to create your account. Subscription is FREE, no credit card required.
Once your account is created, you can login to your account with your email and password:
npx warp login
Let's create a
npx warp project create docker
Let's create a
npx warp env create demo
You're now ready to deploy the server container.
npx warp deploy --project docker --env demo
During the deployment, you will have to indicate the url where you want to access your server after deployment.
✔ Enter a hostname for 'my-docker' (fully qualified or not), leave blank for random: …
You can enter a name or press return to get a random one.
After that step you will have to indicate on which runner to deploy and run your container.
All runners that can be used are shown and you can select the right one.
You can select the configuration
that is a FREE mutalized runner we provide for getting started purposes.
You need to select a runner for deployment configuration 'my-docker'
? Pick a runner or a configuration: ›
❯ Config: scaledynamics-shared-runner
After deployment the url of your container is dumped on the terminal.
if you want to know the deployment url, you can access the console or use the following command to get it:
npx warp env info
Now the server is deployed, let's call it from HTTP using curl for example:
Congrats', you deployed your first Managed HTTP docker.
Want to continue? Create your first Runner