diff --git a/.dockerignore b/.dockerignore index 0b6a882..1c7ce56 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ **.nils /run /run/ +docker-compose.yml diff --git a/README.md b/README.md index 6d87924..333bc9a 100644 --- a/README.md +++ b/README.md @@ -33,12 +33,22 @@ More information can be found on the [Homepage](https://liljudd.ink). ## How to self-host (using the Docker container) -1. Pull the container from [Docker Hub](https://hub.docker.com/repository/docker/limiteddev/liljudd/general) -2. Map /data/ to a folder on disk -3. Run the Bot once -4. follow step 4 and 5 from the JAR section -5. Run the Bot again -6. Profit. +1. Copy the docker-compose.yml file from the repository. +2. Install docker and docker-compose. +3. Create a directory called "data" in the same directory as the docker-compose.yml file. +4. Create a directory called "config" in the same directory as the docker-compose.yml file. +5. Start the bot once. +6. After 10 seconds, stop the bot. +7. Open the config file "credentials.nils" in the config directory. +8. Put in your credentials. + 1. token: your Discord bot token + 2. dbDomain: the domain and port of your postgresql database (e.g.: "postgresql", when using the docker-compose.yml + file) + 3. dbName: the name of the database + 4. dbUser: the username of the database + 5. dbPassword: the password to the db user +9. Start the bot again. +10. The bot should now be up and running. ## How to self-host (using the JAR) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..af8faef --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +version: "3" +services: + lilJudd: + container_name: liljudd + image: limiteddev/liljudd:x.x.x + deploy: + resources: + limits: + cpus: "1" + memory: 1G + networks: + - traefik + restart: unless-stopped + volumes: + - ./config/liljudd/:/data/ + postgresql: + container_name: postgresql + image: postgres:13.3-alpine + deploy: + resources: + limits: + cpus: "1" + memory: 1G + environment: + - POSTGRES_USER=liljudd + - POSTGRES_PASSWORD=changeme + - POSTGRES_DB=liljudd + networks: + - traefik + restart: unless-stopped + volumes: + - ./data/postgresql/:/var/lib/postgresql/data/