Skip to content

Instantly share code, notes, and snippets.

@Asherslab
Created June 22, 2018 05:43
Show Gist options
  • Save Asherslab/b8097c82515e0cb4baa03c3a52748763 to your computer and use it in GitHub Desktop.
Save Asherslab/b8097c82515e0cb4baa03c3a52748763 to your computer and use it in GitHub Desktop.
version: '2'
services:
db:
image: mariadb
restart: always
volumes:
- ./database:/var/lib/mysql
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_DATABASE=panel
- MYSQL_USER=pterodactyl
- MYSQL_PASSWORD=Password123
web:
image: nginx:alpine
restart: always
depends_on:
- php
# ports:
# - 8888:80
# - 4433:443
expose:
- "80"
networks:
- web
- default
volumes:
- ./panel:/home/panel
- ./nginx/site.conf:/etc/nginx/conf.d/default.conf
labels:
- "traefik.docker.network=web"
- "traefik.enable=true"
- "traefik.basic.frontend.rule=Host:admin.lunarsylveon.com"
- "traefik.basic.port=80"
- "traefik.basic.protocol=http"
php:
build: ./phpfpm
restart: always
volumes:
- ./panel:/home/panel
depends_on:
- db
working_dir: /home/panel
environment:
- APP_ENV=local
- DB_CONNECTION=mysql
- DB_HOST=db
- DB_DATABASE=panel
- DB_USERNAME=ptero
- DB_PASSWORD=Password123
redis:
image: redis
restart: always
volumes:
- ./redis:/data
depends_on:
- db
composer:
build: ./composer
restart: "no"
volumes:
- ./panel:/home/panel
working_dir: /home/panel
environment:
- APP_ENV=local
- DB_CONNECTION=mysql
- DB_HOST=db
- DB_DATABASE=panel
- DB_USERNAME=ptero
- DB_PASSWORD=Password123
networks:
web:
external: true
FROM composer
RUN docker-php-ext-install pdo pdo_mysql bcmath
# If using Ubuntu this file should be placed in:
# /etc/nginx/sites-available/
#
# If using CentOS this file should be placed in:
# /etc/nginx/conf.d/
#
server {
listen 80;
server_name _;
root /home/panel/public;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/pterodactyl.app-error.log error;
# allow larger file uploads and longer script runtimes
client_max_body_size 100m;
client_body_timeout 120s;
sendfile off;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~ /\.ht {
deny all;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment