All applications on Vapor Cloud run in a Docker container. This gives full flexibility over what is installed for the specific applications.
Docker files in Vapor Cloud 2 should be located in the root directory (Same place as your
The Dockerfile need to be named after a specific naming scheme.
The name should be
|Replica name||Dockerfile name|
You can use Docker or Docker Compose to test your application locally.
You may experience differences between local and deployed results.
You can build and run your Docker containers manually using
docker build and
docker build -t my-app -f web.Dockerfile
Then run your application with the following command:
docker run --rm -it -p 8080:80 my-app
You can also use Docker Compose to manage your local test images and containers by creating a
docker-compose.yml in the root of your project.
version: '3' services: web: ports: - 8080:80 build: context: . dockerfile: web.Dockerfile
Once saved, you can use the following command to boot your project for testing.
docker-compose up --build web
--build flag will ensure the image is rebuilt with each run.
Applications inside the container need to listen on port 80. If it listens on another port, the application won't work.
The Docker EXPOSE feature is not supported, and will be ignored.