[v3] [wip] docker + docker-compose support #2273
No reviewers
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!2273
Loading…
Reference in a new issue
No description provided.
Delete branch "v3/docker-compose"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Description of the changes
Allows a user to spin up a Red instance by configuring
.envand pressing go. The Red image is built in-tree, and the Lavalink container uses the official image. There is also a Dockerfile included for custom builds of the Lavalink image, but the jar must be provided.Since the Audio cog must be loaded and connected to Lavalink to configure an external server (see #2335), an environment variable check had to be added. It's the simplest way to pass a default hostname through to the LL server connection settings.
TODO:
Similar approach #2163
Not so blocked anymore; this is open for testing and QA while I get documentation together.
This is working on Linux Hosts (tested x86 and x64), and on Windows 10 hosts (tested x64)
I can't test on any other hosts currently.
I can confirm this works on a Windows 10 host, though I want to note that
[p]shutdownjust leads to the bot restarting automatically which could be unexpectedThe last commit is a tweak that lets you use
--abort-on-container-exitin docker-compose to get the desired behavior. This'll be noted in the docs.@palmtree5 you can't stop anything I know from isnide a docker container.
I would set the restart policy of everything to:
restart: unless-stoppedor you easily get sticky containers that can be hard to remove and if one of them errors shit can't just stop it and examine the issue or attach a console.Out of curiosity, what's the status of this PR?
I still have a problem with:
A container could potentially loop with a start up crash and I think this is not a good suggestions.
Debian offers no advantage over Alpine except increasing the image size. IIRC it was the only image that had jre >9 a couple of months ago but this got resolved. If we stick with Debian we just force the user to download about 60 MB more.
Most popular pip packages have a previous alpine for all arches anyway.
Basically the user needs to download the core packages twice for no reason and it significantly increases the image size especially on the end of an image is life cycle.
@Kowlin you can basically use the images but you will probably need to download more data than necessary and need more storage space than necessary.
And look at the todo.
Edit: If you desperately need an image you can take a look at my old multi-arch one https://hub.docker.com/r/supersandro2000/reddiscord/
restart: unless-stoppedbreaks the ability to shut down the bot from discord.Currently possible using
--abort-on-container-exitin composerestart: on-failuremakes sense for this use case.@ -0,0 +1,23 @@FROM python:3.7-slim-busterWhy are the linux headers and alpine sdk kept in the final image?
Put the copy before the first run and combine them or your removal process hurts the image more than it helps.
@ -0,0 +1,25 @@version: "3"If you connect to the lavalink container from another docker container via
lavalinkyou don't need to expose anything on the host.We still need to consider that if those ports are used the container won't start.
You don't run a dist-upgrade in a docker container!!! Either upgrade a package you need to update or build a base image with the updated packages. You potentially create a >400mb diff here and ship those megabaytes twice to the user.
After the build we can remove build essentials if they are not needed on run time and they get removed in the same RUN command.
I think that 3 retries are enough or the container build could be blocked for 1 or 2 minutes before it fails.
@mikeshardmind makes sense. We could argue a whole day about should you be able to but we don't need to.
But we could change the other containers. I just don't like container that start even if I shut them off manually.
@calebj I did a quick branch with all my changes that I think are necessary before this can be merged over here. Feel free to merge or reuse them.
https://github.com/abelfodil/Red-DiscordBot-Docker
This docker image has some things we wouldn’t want by default, the Prefix is set to “-“ and the mentionable flag is also set, one thing worth mentioning too is that’s JSON
Another thing worth flagging up is that Mongo is being depricated, and as such this should be updated to remove anything thats mongo specific (and possibly replace it with postgres)
@calebj is this something you are still actively working on or have you dropped this PR. asking to figure out wether to close and open an issue for Docker support or keep this open as you are working on it but haven't just pushed any changes.
Closing due to innactivity.
Note: Docker support is something we want, however for it to be implemented we require both educating SS as making is avaliable and documented would result in us actively supporting it. There is also other factors to consider here, but if anyone wishes to work on a full docker implementation by all means do so after talking to us in the main server about it (https://discord.gg/red)
Not sure what this means but I hope not what google offered me.
SS as in Support Squad
No it isn't, it refers to support squad, it's an bit of an unfortunate mixing of 2 acronyms
Pull request closed