Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM mcr.microsoft.com/devcontainers/php:8.3-bookworm

# Install PHP 8.3
RUN apt update && apt install -y libjpeg-dev mariadb-client libpng-dev libxml2-dev libwebp-dev libzip-dev libsodium-dev \
&& rm -rf /var/lib/apt/lists/*

RUN docker-php-ext-configure gd --with-jpeg --with-webp \
&& docker-php-ext-configure zip \
&& docker-php-ext-install bcmath gd pdo_mysql zip sodium \
&& docker-php-ext-enable bcmath gd pdo_mysql zip sodium
33 changes: 33 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/php
{
"name": "PHP",
"dockerComposeFile": "docker-compose.yaml",
"service": "app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
80
],
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/node:1": {
"version": "24",
"pnpmVersion": "latest",
"nvmVersion": "latest"
}
},
"customizations": {
"vscode": {
"extensions": [
"fill-labs.dependi",
"ecmel.vscode-html-css",
"p42ai.refactor",
"bradlc.vscode-tailwindcss",
"MaxvanderSchee.web-accessibility",
"dbaeumer.vscode-eslint",
"xdebug.php-pack"
]
}
}
}
108 changes: 108 additions & 0 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
services:
app:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
volumes:
- ../..:/workspaces:cached

command: sleep infinity
environment:
DB_CONNECTION: mariadb
DB_HOST: mariadb
DB_PORT: 3306
DB_DATABASE: panel
DB_USERNAME: pterodactyl
DB_PASSWORD: secret

REDIS_HOST: redis
REDIS_PASSWORD: null
REDIS_PORT: 6379

MAIL_MAILER: smtp
MAIL_HOST: mailhog
MAIL_PORT: 1025
MAIL_USERNAME: null
MAIL_PASSWORD: null
MAIL_ENCRYPTION: null
MAIL_FROM_ADDRESS: no-reply@example.com
MAIL_FROM_NAME: "Pterodactyl Panel"

networks:
- devcontainer-net

depends_on:
- mariadb
- mailhog
- redis

mariadb:
image: mariadb:12.0-noble
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: panel
MYSQL_USER: pterodactyl
MYSQL_PASSWORD: secret
TZ: UTC
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --max-allowed-packet=64M
volumes:
- mariadb_data:/var/lib/mysql
expose:
- "3306"
networks:
- devcontainer-net
healthcheck:
test:
[
"CMD-SHELL",
"mysqladmin ping -h localhost -p${MYSQL_ROOT_PASSWORD} >/dev/null 2>&1 || exit 1",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s

mailhog:
image: mailhog/mailhog:latest
restart: unless-stopped
ports:
- "8025:8025" # Web UI
- "1025:1025" # SMTP
environment:
MH_UI_BIND_ADDR: "0.0.0.0:8025"
MH_SMTP_BIND_ADDR: "0.0.0.0:1025"
networks:
- devcontainer-net
healthcheck:
test:
["CMD-SHELL", "curl -fsS http://localhost:8025/ >/dev/null || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s

redis:
image: redis:7
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes"]
ports:
- "6379:6379"
networks:
- devcontainer-net
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s

volumes:
mariadb_data:

networks:
devcontainer-net:
driver: bridge
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public/assets/manifest.json
docker-compose.*
!docker-compose.example.yml
!docker-compose.example.yaml
!.devcontainer/docker-compose.yaml

# for image related files
misc
Expand Down