| variable | description |
|---|---|
| GITHUB_BASE_URL | Github base url to connect the API |
| GITHUB_USERNAME | Github username, it is intended to only retrieve commmits for this project and this username |
To run this app using docker it would be necessary to create a folder with two files:
In the .env file is where you will put the environment variables described up here. And in the docker-compose.yaml file is where you will configure the app service that is required in order to the app works properly.
Here are examples for this files:
| .env |
|---|
GITHUB_BASE_URL='https://api.github.com'
GITHUB_USERNAME='carlosempd'
| docker-compose.yaml |
|---|
services:
app:
image: carlosempd/gh-test-backend
restart: always
ports:
- 3000:3000
environment:
- GITHUB_BASE_URL=${GITHUB_BASE_URL}
- GITHUB_USERNAME=${GITHUB_USERNAME}
Finally, open a terminal inside the folder created with the two files mentioned above and run:
docker compose up
This will download this image with the latest version (unless you specify one) and will mount the container with the app running.
After that, open in the browser http://localhost:3000/api and you should be able to see the endpoint via swagger documentation and also make requests as indicated in the repository readme file (https://github.com/carlosempd/be-commit-history).
Open a terminal and run the following comand:
docker container run \
-p 3000:3000 \
-e GITHUB_BASE_URL=https://api.github.com \
-e GITHUB_USERNAME=carlosempd \
--name my-app-name \
carlosempd/gh-test-backend
After running this command you will be able to use the api at http://localhost:3000/ as indicated the repository readme file (https://github.com/carlosempd/be-commit-history).
Content type
Image
Digest
sha256:77c954a30…
Size
57.6 MB
Last updated
about 3 years ago
docker pull carlosempd/gh-test-backend