Skip to content

Simple web app to view all the environment variables

License

Notifications You must be signed in to change notification settings

prasadhonrao/env-viewer

Repository files navigation

Node.js Environment Variable Viewer

This Node.js application creates a simple web server that returns all the environment variables defined in the container. It's a useful tool for inspecting environment variable values.

Prerequisites

Before you begin, ensure you have Docker installed on your system.

Building the Docker Image

You can build the Docker image using the following command:

docker build -t env-viewer .

Running the Docker Container

To run a Docker container using the image you've built, you can use the following command:

docker run -d --name env-viewer -p 3000:3000 env-viewer

This command will start a container named env-viewer based on the env-viewer image, which runs the Node.js application and listens on port 3000.

Accessing the Environment Variables

Once the container is running, you can access the environment variables by opening a web browser and navigating to http://localhost:3000 or the IP address of your Docker host. The page will display the names and values of all the environment variables in the container.

Stopping and Removing the Container

When you're done with the container, you can stop and remove it using the following commands:

docker stop env-viewer
docker rm env-viewer

Cleaning Up

To remove the Docker image you built, you can use the following command:

docker rmi env-viewer

Customizing the Application

You can customize the behavior of the application by modifying the server.js file in the same directory as the Dockerfile. For example, you can change the response format or add additional functionality.

About

Simple web app to view all the environment variables

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published