Running Dynacover with Docker - erikaheidi/dynacover GitHub Wiki

Dynacover has a self-contained Docker image that you can use to run the cover update with a single command. The container receives API credentials via a .env file provided at run time.

1. Setting up Credentials

To get started, you'll need to set up your API credentials. Make sure your Twitter application has Read and Write access, then obtain the following keys from the application settings page:

*Consumer / API Token (App token) *Consumer / API Secret (App secret) *Access Key (User token) *Access Secret (User secret)

If you want to showcase GitHub Sponsors, you should also obtain a GitHub personal access token.

Create an environment file using this template. In this example, we'll call the file .dynacover.

cd ~
nano .dynacover
#############################
# Credentials
#############################
DYNA_TWITTER_KEY=
DYNA_TWITTER_SECRET=
DYNA_TWITTER_TOKEN=
DYNA_TWITTER_TOKEN_SECRET=
DYNA_GITHUB_TOKEN=

############################
# Paths
############################
DYNA_TEMPLATES_DIR=
DYNA_IMAGES_DIR=
DYNA_OUTPUT_DIR=

##################################
# Default Template
##################################
#DYNA_DEFAULT_TEMPLATE=cover_basic.json

Save the file once you're done adding your API credentials there. You can also use this file to set up your default template of choice.

2. Testing Twitter Connection

To test that your credentials are valid, you can list your latest followers with the following command, which will spin up a temporary container and inject the environment variables contained in .dynacover:

docker container run --env-file .dynacover --rm -v $(pwd) erikaheidi/dynacover php dynacover fetch followers

3. Updating your Cover

The following command will generate a dynamic cover based on the default template specified in .dynacover, and upload the resulting image as your Twitter header.

docker container run --env-file .dynacover --rm -v $(pwd) erikaheidi/dynacover php dynacover cover update