Sign inSign up

carlosempd/gh-test-backend

By carlosempd

•Updated about 3 years ago

Image
0

109

carlosempd/gh-test-backend repository overview

⁠Github Commit List API

⁠Enviroment Variables

variabledescription
GITHUB_BASE_URLGithub base url to connect the API
GITHUB_USERNAMEGithub username, it is intended to only retrieve commmits for this project and this username

⁠Configuration to run the image in a container

⁠Running the app using a docker-compose.yaml file

To run this app using docker it would be necessary to create a folder with two files:

  • docker-compose.yaml
  • .env

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

⁠Running the app using docker run command

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

Tag summary

Content type

Image

Digest

sha256:77c954a30…

Size

57.6 MB

Last updated

about 3 years ago

docker pull carlosempd/gh-test-backend