S3 / MinIO
Driver: s3
This storage driver stores the cache in a S3 compatible storage, e.g. AWS S3 or MinIO.
Configuration
docker-compose
MinIO example
version: '3.9'
services:
cache-server:
image: ghcr.io/falcondev-oss/github-actions-cache-server:latest
ports:
- '3000:3000'
environment:
API_BASE_URL: http://localhost:3000
STORAGE_DRIVER: s3
STORAGE_S3_BUCKET: gh-actions-cache
AWS_ACCESS_KEY_ID: access_key
AWS_SECRET_ACCESS_KEY: secret_key
AWS_ENDPOINT_URL: http://minio:9000
volumes:
- cache-data:/app/.data
minio:
image: quay.io/minio/minio
ports:
- '9000:9000'
environment:
MINIO_ROOT_USER: access_key
MINIO_ROOT_PASSWORD: secret_key
volumes:
cache-data:
docker-compose
AWS S3 example
This example assumes that credentials are being provided by the environment, e.g. via an instance profile or EKS IRSA.
version: '3.9'
services:
cache-server:
image: ghcr.io/falcondev-oss/github-actions-cache-server:latest
ports:
- '3000:3000'
environment:
API_BASE_URL: http://localhost:3000
STORAGE_DRIVER: s3
STORAGE_S3_BUCKET: gh-actions-cache
volumes:
- cache-data:/app/.data
volumes:
cache-data:
Environment Variables
The only required S3-related environment variables are STORAGE_DRIVER: s3
and STORAGE_S3_BUCKET
. The rest of the environment variables are optional and depend on your S3-compatible storage provider.
The AWS SDK will automatically use any AWS credentials available in the environment, e.g. AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
and AWS_REGION
. Outside of AWS, these environment variables can still be used to authenticate with S3-compatible storage, as seen in the Minio example above.
Common environment variables are listed below. For a full list of configuration options, see the AWS SDK documentation.
STORAGE_S3_BUCKET
Example: gh-actions-cache
The name of the S3 bucket used for storage. This environment variable is always required.
AWS_REGION
Example: us-east-1
The AWS SDK relies on this variable being set. In the cache server, it defaults to us-east-1
if not provided. This has no effect if you are using a non-AWS S3-compatible storage provider, such as MinIO.
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
Example:
AWS_ACCESS_KEY_ID: access_key
AWS_SECRET_ACCESS_KEY: secret_key
This is the access key/secret key used to authenticate with S3-compatible storage. If required to authenticate with your provider, these should be provided by the provider. Alternatively, you can use the AWS_PROFILE
environment variable to specify a profile from your AWS credentials file.
AWS_PROFILE
Example: my-profile
If you wish to run the cache server locally and utilize a profile from your AWS credentials file or local AWS CLI configuration, you can set the AWS_PROFILE
environment variable to the name of the profile. Note that this will also require mounting the AWS credentials file into the container in order for the SDK to be able to find it.
version: '3.9'
services:
cache-server:
image: ghcr.io/falcondev-oss/github-actions-cache-server:latest
ports:
- '3000:3000'
environment:
API_BASE_URL: http://localhost:3000
STORAGE_DRIVER: s3
STORAGE_S3_BUCKET: gh-actions-cache
AWS_PROFILE: my-profile
volumes:
- cache-data:/app/.data
# Mount the AWS CLI credentials and config into the container
- ~/.aws:/root/.aws:ro
volumes:
cache-data:
AWS_ENDPOINT_URL
Example: http://minio:9000
This is the endpoint URL for the S3-compatible storage. This is only required if you are using a non-AWS S3-compatible storage provider, such as MinIO.