Skip to content

Latest commit

 

History

History
49 lines (40 loc) · 1.65 KB

README.md

File metadata and controls

49 lines (40 loc) · 1.65 KB

Red in a container

The goal of this projet is encapsule Red Discord Bot in a container.

Instructions

Due to a issue of docker, a volume is required :

docker volume create NAME-OF-VOLUME
docker run -e TOKEN=YOUR_TOKEN -v NAME-OF-VOLUME:/red/data stelfux/red-discordbot

A more complex exemple (with podman):

podman pod create --name red

podman volume create red-db
podman secret create red-token TOKEN-FILENAME
podman secret create red-db-pass DB-PASS-FILENAME

podman run \
	--secret red-db-password \
	--env POSTGRES_USER=red --env POSTGRES_DB=red \
	--secret red-db-pass,type=env,target=POSTGRES_PASSWORD \
	--volume red-db:/var/lib/postgresql/data:Z \
	--name red-db --pod red --detach \
	docker.io/library/postgres:alpine

podman run \
	--env INSTANCE=NAME_OF_INSTANCE \
	--secret red-token,type=env,target=TOKEN \
    --secret red-db-pass,type=env,target=PGPASSWORD \
	--volume NAME-OF-VOLUME:/red/data:Z \
	--name red-bot --pod red \
	docker.io/stelfux/red-discordbot:postgres \
	--mentionable # or any others args

Settings

Environnement variables :

  • TOKEN: Application Token (see the docs)
  • INSTANCE: Name of the instance (default: bot) For postgres:
  • PGHOST: PostgreSQL server address (default: localhost)
  • PGPORT: PostgreSQL server port (default: 5432)
  • PGUSER: PostgreSQL server username (default: red)
  • PGPASSWORD: PostgreSQL server password
  • PGDATABASE: PostgreSQL database's name (default: name)