Code Monkey home page Code Monkey logo

docker's Introduction

Blueprint Docker

Blueprint's extension ecosystem you know and love, in ๐Ÿณ Docker.


๐Ÿณ Blueprint in Docker

Uploading extensions

Extensions must be placed/dragged into the extensions folder.

Interacting with Blueprint

By default, you can only interact with Blueprint by going through the Docker command line, i.e.

docker compose exec panel blueprint (arguments)

We recommend setting an alias so you can interact with Blueprint the same way you would in the non-Docker version (If you have your compose file in a different place, adjust accordingly:

# Set alias for current session
alias blueprint="docker compose -f /srv/pterodactyl/docker-compose.yml exec panel blueprint"
# Append to the end of your .bashrc file to make it persistent
echo 'alias blueprint="docker compose -f /srv/pterodactyl/docker-compose.yml exec panel blueprint"' >> ~/.bashrc

Example of installing an extension

Here's a quick example showcasing how you would go about installing extensions on the Docker version of Blueprint. Note that your experience can differ for every extension.

  1. Find an extension you would like to install and look for a file with the .blueprint file extension.
  2. Drag/upload the example.blueprint file over/onto to your extensions folder, i.e. by default /srv/pterodactyl/extensions.
  3. Install the extension through the Blueprint command line tool:
    docker compose exec panel blueprint -i example
    Alternatively, if you have applied the alias we suggested above:
    blueprint -i example

So, you installed your first extension. Congratulations! Blueprint is now keeping persistent data inside the pterodactyl_app volume, so you'll want to start backing that volume up regularly.

First, we'll install Restic to handle backups

Why Restic? Compression, de-duplication, and incremental backups. Save on space compared to simply archiving the directory each time. The package name is usually restic, i.e.

Operating System Command
Ubuntu / Debian / Linux Mint sudo apt -y install restic
Fedora sudo dnf -y install restic
Rocky Linux / AlmaLinux / CentOS sudo dnf -y install epel-release && sudo dnf -y install restic
Arch Linux sudo pacman -S --noconfirm restic
openSUSE sudo zypper install -n restic
Gentoo sudo emerge --ask=n app-backup/restic

Make a directory and script for backups

mkdir -p /srv/backups/pterodactyl
restic init --repo /srv/backups/pterodactyl
cat <<'EOF' > /srv/backups/backup.sh
#!/bin/bash

docker compose -f /srv/pterodactyl/docker-compose.yml down
restic backup /var/lib/docker/volumes/pterodactyl_app/_data --repo /srv/backups/pterodactyl
docker compose -f /srv/pterodactyl/docker-compose.yml up -d
EOF
chmod +x /srv/backups/backup.sh

Set a crontab to back up your panel (choose a time when it will be least likely to be being used)

(crontab -l 2>/dev/null; echo "59 23 * * * /srv/backups/backup.sh") | crontab -

Well, great. I have daily backups now, and they're set to keep at most 30 backups at a time. How can I restore from one of them?

You can list snapshots with restic snapshots --repo /srv/backups/pterodactyl You're looking for a value for ID that looks something like 46adb587. Time will be right next to each ID, so you can see what day your backups are from.

Once you've determined which snapshot you want to restore, stop your compose stack, restore your data, and start your stack again

docker compose -f /srv/pterodactyl/docker-compose.yml down
# Clear the directory so the restoration will be clean
rm -rf /var/lib/docker/volumes/pterodactyl_app/_data
# Remember to replace "46adb587" with your actual ID of the snapshot you want to restore
restic restore 46adb587 --repo /srv/backups/pterodactyl --target /var/lib/docker/volumes/pterodactyl_app/_data
docker compose -f /srv/pterodactyl/docker-compose.yml up -d

Updating Blueprint in Docker

  • This guide operates under the assumption that individual extension/theme authors have chosen to store any persistent data such as settings in the database. If they have not done this... there isn't any specific place extension data is meant to be stored, so the data could be anywhere. You'll need to ask them if there is any persistent data stored anywhere that you have to back up before updating.
  • Go to the directory of your docker-compose.yml file
  •   docker compose down -v
  • The -v tells it to delete any named volumes, i.e. the app volume we use. It will not delete data from bind-mounts. This way the new image's app volume can take place.
  • Change the tag in your panel's image (i.e. to upgrade from v1.11.5 to v1.11.7, you would change ghcr.io/blueprintframework/blueprint:v1.11.5 to ghcr.io/blueprintframework/blueprint:v1.11.7.
  •   docker compose pull
  •   docker compose up -d
  • Lastly, install your extensions again. Refer to the examples.
  • Blueprint will support installing multiple extensions at once in the future, making updates significantly easier. The syntax showcased was blueprint -i extension1 extension2 extension3. Documentation here will be updated when that comes out, but for now you'll have to install each extension again every update. Feel free to automate this with a simple bash script:
    • Create the script
      • cd /srv/pterodactyl && echo -e '#!/bin/bash\n\nfor extension in "$@"\ndo\n    docker compose exec panel blueprint -i "$extension"\ndone' > bulk-install.sh && chmod +x bulk-install.sh
    • The script will be located in the assumed root folder for your compose stack, /srv/pterodactyl. You can use it while in that folder with as many extensions as you want with:
      •   ./bulk-install.sh extension1 extension2 extension3``



$\color{#4b4950}{\textsf{ยฉ 2024 Ivy (prpl.wtf) and Loki}}$

docker's People

Contributors

loki-101 avatar prplwtf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker's Issues

Add "latest" tag to images

It would be really great if there would be a "latest" tag. I know it's unsafe for production use, but I'd be glad to have it when testing on my home setup.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.