This folder contains a Docker app that is meant to be used for demonstration purposes only. You should follow the example in this code in your own apps and then remove this sample app once things are working.
This Docker container contains a simple "Hello World!" Node.js app.
The provided Docker Compose file allows you to run the app locally in development. To start the container, run:
$ docker-compose up
Once the stack has launched, you can test the application by navigating to:
- http://localhost:8080/ to access the "Hello World!" message.
Simply run:
$ npm run test
- Configure Docker to use
gcloud
as a credential helper. Your Docker client version must be 1.13 or newer.
gcloud auth configure-docker
- Build and tag your image.
docker build -t [GCP-CONTAINER-REGISTRY-HOSTNAME]/[PROJECT-ID]/sample-app-docker .
- Push the Docker image
docker push [GCP-CONTAINER-REGISTRY-HOSTNAME]/[PROJECT-ID]/sample-app-docker
The Container Registry hostname will vary according to your region. For more information, check the Container Registry docs.