Skip to content

Commit d395ebf

Browse files
committed
feat: pterodactyl docker setup + CD
0 parents  commit d395ebf

File tree

4 files changed

+102
-0
lines changed

4 files changed

+102
-0
lines changed

.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"

.github/workflows/deployment.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
11+
environment:
12+
name: production
13+
url: https://codinglab.gg
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: arwynfr/actions-docker-context@v2
19+
with:
20+
docker_host: 'ssh://${{ secrets.CODINGLABGG_SSH_USER }}@${{ secrets.CODINGLABGG_SSH_HOST }}'
21+
context_name: 'prod-server'
22+
ssh_key: ${{ secrets.CODINGLABGG_SSH_KEY }}
23+
ssh_cert: ${{ secrets.CODINGLABGG_SSH_CERT }}
24+
25+
- name: 'Docker compose up on the production server'
26+
working-directory: .
27+
run: docker --context prod-server compose up -d
28+
env:
29+
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
30+
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }}

.gitignore

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

docker-compose.yml

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

0 commit comments

Comments
 (0)