Open ADRFranklin opened 3 years ago
Can you provide an MVCE for this? A simple Docker compose config and Pico target
Sure,
Config
E("DATA_DIR", "/storage");
E("MACHINE_NAME", HOSTNAME);
var GITLAB_HOST = "https://gitlab.com/";
A({
name: "gitlab",
path: "/pico",
user_key: "GIT_USERNAME",
pass_key: "GIT_PASSWORD",
});
function Compose(name) {
return {
name: name,
url: GITLAB_HOST + "user/" + name,
up: ["docker-compose", "up", "-d"],
down: ["docker-compose", "down"],
auth: "gitlab",
};
}
if (HOSTNAME === "local-01") {
E("DOMAIN_NAME", "domain");
T(Compose("pico-pterodactyl-panel"));
}
pico-pterodactyl-panel docker compose
version: '2.3'
networks:
default:
driver: bridge
gateway:
external:
name: gateway
services:
##
# --Pterodactyl Panel--
# This is the container that provides the main web interface.
##
panel:
depends_on:
cache:
condition: service_started
env_file: ${DATA_DIR:?required}/pterodactyl/conf.d/panel.env
image: ccarney16/pterodactyl-panel:latest
restart: always
networks:
- default
- gateway
volumes:
- ${DATA_DIR:?required}/pterodactyl/panel:/data
# Enable Let's Encrypt Support
- ${DATA_DIR:?required}/pterodactyl/conf.d/letsencrypt:/etc/letsencrypt
- ${DATA_DIR:?required}/pterodactyl/conf.d/letsencrypt/webroot/.well-known:/var/www/html/public/.well-known
- ${DATA_DIR:?required}/pterodactyl/conf.d/certs:/etc/certs
labels:
- "traefik.enable=true"
- "traefik.docker.network=gateway"
- "traefik.http.routers.pterodactyl-panel.rule=Host(`panel-${HOSTNAME:?required}.${DOMAIN_NAME:?required}`)"
- "traefik.http.routers.pterodactyl-panel.entrypoints=https"
- "traefik.http.routers.pterodactyl-panel.tls.certresolver=default"
- "traefik.http.services.pterodactyl-panel.loadbalancer.server.port=80"
- "com.centurylinklabs.watchtower.enable=true"
##
# --Worker--
# These are required for schedules and other misc tasks to
# function correctly.
##
worker:
command: wait-for -t 5 panel:80 -- php /var/www/html/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
networks:
- default
depends_on:
panel:
condition: service_started
env_file: ${DATA_DIR:?required}/pterodactyl/conf.d/panel.env
image: ccarney16/pterodactyl-panel:latest
labels:
ofelia.enabled: "true"
ofelia.job-exec.pqueue.schedule: "@every 1m"
ofelia.job-exec.pqueue.command: "php /var/www/html/artisan schedule:run"
ofelia.job-exec.pqueue.user: "nginx"
restart: always
volumes_from:
- panel
cron:
command: daemon --docker
depends_on:
panel:
condition: service_started
worker:
condition: service_started
image: mcuadros/ofelia:latest
network_mode: none
privileged: true
restart: always
volumes:
- ${DOCKER_SOCKET:-/var/run/docker.sock}:${DOCKER_SOCKET:-/var/run/docker.sock}
##
# --Redis--
# Handles Session Data
##
cache:
networks:
- default
cpu_count: 2
cpu_percent: 50
image: redis:alpine
mem_limit: 128m
restart: always
##
# --MariaDB--
# Required for the control panel to work.
# Stores Server/User information
##
game_mysql:
image: mariadb:10.4
networks:
- default
env_file: ${DATA_DIR:?required}/pterodactyl/conf.d/mariadb.env
ports:
- ${MYSQL_ADDRESS:-3306}
restart: always
volumes:
- ${DATA_DIR:?required}/pterodactyl/db:/var/lib/mysql
link to env files needed https://github.com/ccarney16/pterodactyl-containers/tree/master/manifest/config/env
after testing a little bit with this, it seems when deploying with pico, docker compose is unable to find env files on the host system, which can be confirmed when you copy pico's params that are passed to docker compose and run them yourself.
Pico's Attempt:
Manual Attempt:
as seen from above, running manually works perfectly fine.