142 lines
4.5 KiB
YAML
142 lines
4.5 KiB
YAML
# documentation: https://pterodactyl.io/
|
|
# slogan: Pterodactyl is a free, open-source game server management panel
|
|
# category: media
|
|
# tags: game, game server, management, panel, minecraft
|
|
# logo: svgs/pterodactyl.png
|
|
# port: 80, 8443
|
|
|
|
services:
|
|
mariadb:
|
|
image: mariadb:10.5
|
|
healthcheck:
|
|
test:
|
|
["CMD-SHELL", "healthcheck.sh --connect --innodb_initialized || exit 1"]
|
|
start_period: 10s
|
|
interval: 10s
|
|
timeout: 1s
|
|
retries: 3
|
|
environment:
|
|
- MYSQL_ROOT_PASSWORD=$SERVICE_PASSWORD_MYSQLROOT
|
|
- MYSQL_DATABASE=pterodactyl-db
|
|
- MYSQL_USER=$SERVICE_USER_MYSQL
|
|
- MYSQL_PASSWORD=$SERVICE_PASSWORD_MYSQL
|
|
volumes:
|
|
- pterodactyl-db:/var/lib/mysql
|
|
|
|
redis:
|
|
image: redis:alpine
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "redis-cli ping || exit 1"]
|
|
interval: 10s
|
|
timeout: 1s
|
|
retries: 3
|
|
|
|
pterodactyl:
|
|
image: ghcr.io/pterodactyl/panel:latest
|
|
volumes:
|
|
- "panel-var:/app/var/"
|
|
- "panel-nginx:/etc/nginx/http.d/"
|
|
- "panel-certs:/etc/letsencrypt/"
|
|
- type: bind
|
|
source: ./etc/entrypoint.sh
|
|
target: /entrypoint.sh
|
|
mode: "0755"
|
|
content: |
|
|
#!/bin/sh
|
|
set -e
|
|
|
|
echo "Setting logs permissions..."
|
|
chown -R nginx: /app/storage/logs/
|
|
|
|
USER_EXISTS=$(php artisan tinker --no-ansi --execute='echo \Pterodactyl\Models\User::where("email", "'"$ADMIN_EMAIL"'")->exists() ? "1" : "0";')
|
|
|
|
if [ "$USER_EXISTS" = "0" ]; then
|
|
echo "Admin User does not exist, creating user now."
|
|
php artisan p:user:make --no-interaction \
|
|
--admin=1 \
|
|
--email="$ADMIN_EMAIL" \
|
|
--username="$ADMIN_USERNAME" \
|
|
--name-first="$ADMIN_FIRSTNAME" \
|
|
--name-last="$ADMIN_LASTNAME" \
|
|
--password="$ADMIN_PASSWORD"
|
|
echo "Admin user created successfully!"
|
|
else
|
|
echo "Admin User already exists, skipping creation."
|
|
fi
|
|
|
|
exec supervisord --nodaemon
|
|
command: ["/entrypoint.sh"]
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -sf http://localhost:80 || exit 1"]
|
|
interval: 10s
|
|
timeout: 1s
|
|
retries: 3
|
|
environment:
|
|
- SERVICE_URL_PTERODACTYL_80
|
|
- ADMIN_EMAIL=${ADMIN_EMAIL:-admin@example.com}
|
|
- ADMIN_USERNAME=${SERVICE_USER_ADMIN}
|
|
- ADMIN_FIRSTNAME=${ADMIN_FIRSTNAME:-Admin}
|
|
- ADMIN_LASTNAME=${ADMIN_LASTNAME:-User}
|
|
- ADMIN_PASSWORD=${SERVICE_PASSWORD_ADMIN}
|
|
- PTERODACTYL_HTTPS=${PTERODACTYL_HTTPS:-false}
|
|
- APP_ENV=production
|
|
- APP_ENVIRONMENT_ONLY=false
|
|
- APP_URL=$SERVICE_URL_PTERODACTYL
|
|
- APP_TIMEZONE=${TIMEZONE:-UTC}
|
|
- APP_SERVICE_AUTHOR=${APP_SERVICE_AUTHOR:-author@example.com}
|
|
- LOG_LEVEL=${LOG_LEVEL:-debug}
|
|
- CACHE_DRIVER=redis
|
|
- SESSION_DRIVER=redis
|
|
- QUEUE_DRIVER=redis
|
|
- REDIS_HOST=redis
|
|
- DB_DATABASE=pterodactyl-db
|
|
- DB_USERNAME=$SERVICE_USER_MYSQL
|
|
- DB_HOST=mariadb
|
|
- DB_PORT=3306
|
|
- DB_PASSWORD=$SERVICE_PASSWORD_MYSQL
|
|
- MAIL_FROM=$MAIL_FROM
|
|
- MAIL_DRIVER=$MAIL_DRIVER
|
|
- MAIL_HOST=$MAIL_HOST
|
|
- MAIL_PORT=$MAIL_PORT
|
|
- MAIL_USERNAME=$MAIL_USERNAME
|
|
- MAIL_PASSWORD=$MAIL_PASSWORD
|
|
- MAIL_ENCRYPTION=$MAIL_ENCRYPTION
|
|
|
|
wings:
|
|
image: "ghcr.io/pterodactyl/wings:latest"
|
|
environment:
|
|
- SERVICE_URL_WINGS_8443
|
|
- "TZ=${TIMEZONE:-UTC}"
|
|
- WINGS_USERNAME=$SERVICE_USER_WINGS
|
|
volumes:
|
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
|
- "/var/lib/docker/containers/:/var/lib/docker/containers/"
|
|
- "/var/lib/pterodactyl/volumes:/var/lib/pterodactyl/volumes"
|
|
- "/tmp/pterodactyl:/tmp/pterodactyl"
|
|
- wings_lib:/var/lib/pterodactyl/
|
|
- wings_logs:/var/log/pterodactyl/
|
|
- type: bind
|
|
source: ./etc/config.yml
|
|
target: /etc/pterodactyl/config.yml
|
|
content: |
|
|
debug: false
|
|
uuid: ReplaceConfig
|
|
token_id: ReplaceConfig
|
|
token: ReplaceConfig
|
|
api:
|
|
host: 0.0.0.0
|
|
port: 8443 # Warning, panel must have 443 as daemon port, while here it should should be 8443, FQDN in Coolify for this service should be https://*:8443
|
|
ssl:
|
|
enabled: false
|
|
cert: ReplaceConfig
|
|
key: ReplaceConfig
|
|
upload_limit: 100
|
|
system:
|
|
data: /var/lib/pterodactyl/volumes
|
|
sftp:
|
|
bind_port: 2022
|
|
allowed_mounts: []
|
|
remote: ''
|
|
ports:
|
|
- '2022:2022'
|