Build a simple GraphQL API using Dockerfile locally.
Demonstrate layer caching by adding a dummy RUN
instruction.
Note: Make sure to execute the below commands in the demo directory.
docker build -t api .
alias dive="docker run -ti --rm -v /var/run/docker.sock:/var/run/docker.sock wagoodman/dive"
dive api
docker run --name api -d -p 80:4000 api
curl -s 'http://localhost/' -X POST -H 'content-type: application/json' --data '{ "query": "{ teams { id name members department } }" }' | jq
docker rm -f api
Push a commit to the master
branch to start the GitHub Actions workflow.
docker run --name graphql-demo-api -d -p 80:4000 sthristov/graphql-demo-api:2021-11-17-69f29a69
curl -s 'http://localhost/' -X POST -H 'content-type: application/json' --data '{ "query": "{ teams { id name members department } }" }' | jq
docker rm -f graphql-demo-api