Create a new Vapor Project & move into that folder
$ vapor new [project name]
$ cd [project name]
Copy Makefile
and Dockerfile
into the project directory
Run make docker
To see server logs run make docker-debug
.
Note that command fails if a docker image isn't currently running because it attempts to remove currently running image under the same name.
Why? I was running into the problem of the port already being bound and adding the --rm
flag to the docker run command didn't seem to help so I just used the suggestion to rm
all running containers to fix it. However if no containers are running it fails. ¯\(ツ)/¯ not enough of a problem for me to really care and fix it yet.