skycliinstalled and configured properly.
dartserverand go inside:
skycliapp creation command and give the new app a name. It's better to prefix you app name with your name or alias like your GitHub ID, since Skygear cluster is shared among everyone who has an account and it's likely someone has already taken the app name
main.dartwith a simple "Hello World!" API implemented.
Dockerfiledescribes how a private filesystem of a container should be assembled and carry instructions on how a container is run based on the image built from it. Think of it as a step-by-step recipe on how an image is built, where the container instances can be started based on the image.
Dockerfilewe have here describes how our dart server should be converted to an image.
tiniis included, to prevent spawns of zombie processes and provide default signal handlers in container instances.
main.dartis compiled to
a.out. The latter file which functions exactly like the former is then executed at line 10. Containers deployed from the image built from this will have our dart server running on them.
Dockerfile. For more information on
Dockerfile, please refer to its official doc.
skygear.yamlso that your file tree in
dartserverlooks like this:
deployments, i.e line 3-7 in our yaml file, is a service registered under an app. Files in our local directory
dartserver, indicated as
skygear.yamlresides in it, are uploaded and deployed as a service called
server. Port 4040 where our Dart server responses with a "Hello World!" message is mapped to the service
serverunder the path
skycliwill look for a
Dockerfile. Skygear will interpret the
Dockerfilewhen supplied and finish up all the deployment chores for you.
.skyignorefile. It works the same as