Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 975 Bytes

README.md

File metadata and controls

32 lines (23 loc) · 975 Bytes

Demo 7

Introduction to Dockerfile

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 .
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

GitHub Actions build

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

Navigation