Sign inSign up

freshwebio/apydox-api

By freshwebio

•Updated over 6 years ago

The API for the apydox portal that connects with Github accounts through OAuth

Image
1

167

freshwebio/apydox-api repository overview

⁠apydox api

apydox is an open source portal for API documentation for managing API definitions for a collection of services in the OpenAPI specification⁠ format. The apydox project embeds the swagger-editor to provide a powerful inline editing experience for managing your API documentation backed by a Github repository of your choosing.

This docker image provides an instance of the API part of the apydox project that manages Github OAuth tokens.

⁠Tags

When it comes to tags :dev is always representative of what is on the master branch of the project and tags that represent a particular release are named by version number. An example would be for release v0.1.0, the docker image tag would be version-0.1.0. To use a particular version of the api you will need to be explicit and refer to the image version you want to use.

There is no use of the :latest tag convention for this project, you will have to explicitly define the version of the api you want to deploy or make use of.

An example of this would be something like this:

docker run -p 54093:4305 -v /path/to/yourcompany:/config freshwebio/apydox-api:version-0.1.0
⁠Configuration you can provide

The following is a table of all the configuration you can provide when running the API.

Name in config fileName as environment variable
apydox_api_github_client_idAPYDOX_API_GITHUB_CLIENT_IDThe Github client id of your OAuth app⁠
apydox_api_github_client_secretAPYDOX_API_GITHUB_CLIENT_SECRETThe Github client secret of your OAuth app
apydox_api_portAPYDOX_API_PORTThe port the api will run on inside the docker container (4305 is the default port the api runs on)
apydox_api_tlsAPYDOX_API_TLSA flag to be set to true if the api is responsible for serving endpoints over https with it's own tls certificates (useful for local testing)
apydox_env_testAPYDOX_ENV_TESTA flag to be set to true if the current environment is for running automated tests.
⁠Mounting API configuration
⁠Step 1

First create a conf file with the appropriate configuration set like the following:

--- yourcompany.apydox.conf

apydox_api_github_client_id Zdafasdasdfasdadfsd
apydox_api_github_client_secret 40f9gsdf83kfwdgfasdfafi3q9e8das
⁠Step 2

Now mount the file and ensure you set the environment variable for the location of your file when you run the container:

docker run -p 54093:4305  -e APYDOX_API_CONFIG_FILE=/path/in/container/for/yourcompany.apydox-api.conf \ 
  -v /path/to/yourcompany.apydox-api.conf:/path/in/container/for/yourcompany.apydox-api.conf freshwebio/apydox-api:{version}

Alternatively, you don't have to specify the APYDOX_API_CONFIG_FILE as long as you mount your config file to the default location of /config/apydox-api.conf and name your config file apydox-api.conf like so:

docker run -p 54093:4305 -v /path/to/yourcompany:/config freshwebio/apydox-api:{version}

/path/to/{yourcompany} in the command above is the folder that contains your configuration file.

⁠Providing configuration via environment variables

You can also provide all the configuration as environment variables to the docker container with something like the following:

docker run -p 54093:4305 -e APYDOX_API_GITHUB_CLIENT_ID=f0f9wfadfafk23j2fasf \
  -e APYDOX_API_GITHUB_CLIENT_SECRET=059gsfg8234t7wdgsdrqsfgafsg92343142832492 \
  freshwebio/apydox-api:{version}
⁠Example using docker-compose
⁠With configuration file
version: '3.2'

services:
  apydox-api:
    image: freshwebio/apydox-api:{version}
    ports:
      - '54093:4305'
    environment:
      APYDOX_API_CONFIG_FILE: '/path/in/container/for/yourcompany.apydox-api.conf'
    volumes:
      - '/path/to/yourcompany.apydox-api.conf:/path/in/container/for/yourcompany.apydox-api.conf'
⁠With environment variables
version: '3.2'

services:
  apydox-api:
    image: freshwebio/apydox-api:{version}
    ports:
      - '54093:4305'
    environment:
      APYDOX_API_GITHUB_CLIENT_ID: 'f0f9wfadfafk23j2fasf'
      APYDOX_API_GITHUB_CLIENT_SECRET: '059gsfg8234t7wdgsdrqsfgafsg92343142832492'

Tag summary

Content type

Image

Digest

Size

13 MB

Last updated

over 6 years ago

docker pull freshwebio/apydox-api:dev