Skip to content

Commit e8e6dc0

Browse files
committed
feat: minimal pterodactyl setup
0 parents  commit e8e6dc0

File tree

4 files changed

+101
-0
lines changed

4 files changed

+101
-0
lines changed

.github/workflows/deployment.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
name: 'Publish pterodactyl stack on the production server'
10+
steps:
11+
- uses: actions/checkout@v4
12+
13+
- uses: arwynfr/actions-docker-context@v2
14+
with:
15+
docker_host: 'ssh://${{ secrets.CODINGLABGG_SSH_USER }}@${{ secrets.CODINGLABGG_SSH_HOST }}'
16+
context_name: 'prod-server'
17+
ssh_key: ${{ secrets.CODINGLABGG_SSH_KEY }}
18+
ssh_cert: ${{ secrets.CODINGLABGG_SSH_CERT }}
19+
20+
- name: 'Github actions secrets to env'
21+
run: |
22+
echo "MYSQL_PASSWORD=${{ secrets.MYSQL_PASSWORD }}" >> $GITHUB_ENV
23+
echo "MYSQL_ROOT_PASSWORD=${{ secrets.MYSQL_ROOT_PASSWORD }}" >> $GITHUB_ENV
24+
25+
- name: 'Docker compose up on the production server'
26+
working-directory: ./packages/pterodactyl
27+
run: docker --context prod-server compose up -d

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

packages/pterodactyl/.env.template

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
MYSQL_PASSWORD="something"
3+
MYSQL_ROOT_PASSWORD="something but stronger"
+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# source: https://technotim.live/posts/pterodactyl-game-server/
2+
version: '3.8'
3+
x-common:
4+
database: &db-environment
5+
MYSQL_PASSWORD: &db-password ${MYSQL_PASSWORD}
6+
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
7+
panel:
8+
&panel-environment # This URL should be the URL that your reverse proxy routes to the panel server
9+
APP_URL: 'https://codinglab.gg'
10+
# A list of valid timezones can be found here: http://php.net/manual/en/timezones.php
11+
APP_TIMEZONE: 'Europe/Paris'
12+
APP_SERVICE_AUTHOR: '[email protected]'
13+
TRUSTED_PROXIES: '*' # Set this to your proxy IP
14+
# Uncomment the line below and set to a non-empty value if you want to use Let's Encrypt
15+
# to generate an SSL certificate for the Panel.
16+
# LE_EMAIL: ""
17+
mail: &mail-environment
18+
MAIL_FROM: '[email protected]'
19+
MAIL_DRIVER: 'smtp'
20+
MAIL_HOST: 'mail'
21+
MAIL_PORT: '1025'
22+
MAIL_USERNAME: ''
23+
MAIL_PASSWORD: ''
24+
MAIL_ENCRYPTION: 'true'
25+
26+
# ------------------------------------------------------------------------------------------
27+
services:
28+
database:
29+
image: mariadb:10.5
30+
restart: always
31+
command: --default-authentication-plugin=mysql_native_password
32+
volumes:
33+
- '/srv/pterodactyl/database:/var/lib/mysql'
34+
environment:
35+
<<: *db-environment
36+
MYSQL_DATABASE: 'panel'
37+
MYSQL_USER: 'pterodactyl'
38+
cache:
39+
image: redis:alpine
40+
restart: always
41+
panel:
42+
image: ghcr.io/pterodactyl/panel:latest
43+
restart: always
44+
ports:
45+
- '80:80'
46+
- '443:443'
47+
links:
48+
- database
49+
- cache
50+
volumes:
51+
- '/srv/pterodactyl/var/:/app/var/'
52+
- '/srv/pterodactyl/nginx/:/etc/nginx/http.d/'
53+
- '/srv/pterodactyl/certs/:/etc/letsencrypt/'
54+
- '/srv/pterodactyl/logs/:/app/storage/logs'
55+
environment:
56+
<<: [*panel-environment, *mail-environment]
57+
DB_PASSWORD: *db-password
58+
APP_ENV: 'production'
59+
APP_ENVIRONMENT_ONLY: 'false'
60+
CACHE_DRIVER: 'redis'
61+
SESSION_DRIVER: 'redis'
62+
QUEUE_DRIVER: 'redis'
63+
REDIS_HOST: 'cache'
64+
DB_HOST: 'database'
65+
DB_PORT: '3306'
66+
networks:
67+
default:
68+
ipam:
69+
config:
70+
- subnet: 172.20.0.0/16

0 commit comments

Comments
 (0)