- Docker installed on your machine
-
Build the Docker Image
Navigate to the root directory of your project and run the following command to build the Docker image:
docker build -t oanda-trading-api .
-
Run the Docker Container
After the image is built, run the following command to start a container from the image:
docker run -p 8080:8080 -e OANDA_API_KEY=${OANDA_API_KEY} --name oanda-trading-container oanda-trading-api
This will start the application and map port 8080 of the container to port 8080 on your host machine.
-
Stop the Docker Container
To stop the running container, you can use the
docker ps
command to find the container ID and then stop it using thedocker stop
command:docker stop oanda-trading-container
-
Remove the Docker Container
If you want to remove the container, you can use the
docker rm
command:docker rm oanda-trading-container
Once the container is running, you can access the application by navigating to http://localhost:8080
in your web browser.
To stop the running container, you can use the docker ps
command to find the container ID and then stop it using the docker stop
command:
docker ps
docker stop <container_id>
Replace <container_id>
with the actual ID of your running container.
This `README.md` file provides clear instructions on how to build and run the Docker container for your project.