- Sysl v0.11.0 or later
- Go 1.16 or later
Sysl-go generates a fully functional Go server from specification alone.
All files within the internal/gen
directory are generated by Sysl-go.
The generated files are committed into the repository, however for the
purpose of instruction, these files can be regenerated with the following
command
make all -B
To build a docker container image for the application using the template Dockerfile, you first need to vendor all the dependencies. You can do so with the command
go mod vendor
Then run:
docker build -t docker_petdemo -f Dockerfile .
To run the application inside the container, you need to prepare an
application config file. Assuming you have an application config file
present as config.yaml
, the containerised application can be run as:
docker run --rm -t -p 8080:8080 --mount type=bind,source="$PWD"/config/config.yaml,target=/app/config.yaml,readonly docker_petdemo:latest /bin/Petdemo /app/config.yaml
To connect to the application, navigate to http://localhost:8080/pet in your browser or use the following curl command:
curl http://localhost:8080/pet