Skip to content

Commit

Permalink
m
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-tharwat committed Jul 25, 2024
1 parent 71d81ef commit 5734e4d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 114 deletions.
4 changes: 4 additions & 0 deletions app/Helpers/UserSystemInfoHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public static function get_ip(){
$ipaddress = $_SERVER['HTTP_FORWARDED'];
else if(isset($_SERVER['REMOTE_ADDR']))
$ipaddress = $_SERVER['REMOTE_ADDR'];
else if(isset($_SERVER['X-Real-IP']))
$ipaddress = $_SERVER['X-Real-IP'];
else if(isset($_SERVER['X-Real-IP']))
$ipaddress = $_SERVER['X-Real-IP'];
else if(request()->ip()!=null)
$ipaddress = request()->ip();
else
Expand Down
113 changes: 0 additions & 113 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
services:
<<<<<<< HEAD
# We need to run the FPM container for our application
laravel.fpm:
build:
Expand Down Expand Up @@ -91,115 +90,3 @@ networks:

volumes:
laravel-in-kubernetes-mysql:
=======

php:
build:
context: "."
dockerfile: "Dockerfile"
restart: unless-stopped
#ports:
# - 9000:9000
volumes:
- ./:/var/www/html
- ./docker/php-fpm/php-fpm.ini:/opt/bitnami/php/etc/php-fpm.conf
- ./docker/php-fpm/php.ini:/usr/local/etc/php/php.ini-production
- ./docker/php-fpm/php-dev.ini:/usr/local/etc/php/php.ini-development
environment:
PHP_UPLOAD_MAX_FILESIZE: '2000M'
PHP_POST_MAX_SIZE: '2000M'
PHP_MAX_EXECUTION_TIME: '300'
PHP_MEMORY_LIMIT: '50000M'
expose:
- 9000
networks:
# - public_network
- internal_network
deploy:
mode: replicated
replicas: 2

#depends_on:
# - nginx
nginx:
image: nginx:1.27.0
restart: unless-stopped
ports:
- 80:80
- 443:443
volumes:
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./docker/nginx/site.conf:/etc/nginx/conf.d/default.conf
- ./docker/nginx/ssl:/etc/nginx/ssl
- ./:/var/www/html
- ./docker/certbot/conf:/etc/letsencrypt
- ./docker/certbot/html:/var/www/certbot
depends_on:
- php
environment:
DOMAIN_NAME: superzaki.com
networks:
- internal_network
- public_network

db:
image: mysql:8.0.36
restart: unless-stopped
ports:
- "${DB_PORT-3306}:3307"
volumes:
- /mnt/blockstorage/mysql:/var/lib/mysql_docker
- ./docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf
- ./docker/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_HOST: "%"
#MYSQL_USER: ${DB_USERNAME}
MYSQL_ALLOW_EMPTY_PASSWORD: true
networks:
- internal_network

composer:
image: composer
volumes:
- ./docker/php-composer/entrypoint.sh:/entrypoint.sh
- ./:/var/www/html
- ./docker/php-composer/.composer_json_hash:/var/www/composer_json_hash/.composer_json_hash
working_dir: /var/www/html
entrypoint: /bin/sh -c '/entrypoint.sh'
environment:
COMPOSER_ALLOW_SUPERUSER: '1'
depends_on:
- php
- nginx

certbot:
image: certbot/certbot:latest
volumes:
- ./docker/certbot/entrypoint.sh:/entrypoint.sh
- ./docker/certbot/conf:/etc/letsencrypt
- ./docker/certbot/html:/var/www/certbot
- ./docker/nginx/site.conf:/var/www/nginx/site.conf
- ./docker/nginx/ssl:/var/www/nginx/ssl
environment:
- APP_URL=${APP_URL}
- DOMAIN_NAME=superzaki.com
entrypoint: /bin/sh -c '/entrypoint.sh'
depends_on:
- nginx
restart: "no"


networks:
public_network:
driver: bridge

internal_network:
internal: true


#networks:
# network:
>>>>>>> 48300f898e165367a43d20c975bac0c51e37efe0
12 changes: 11 additions & 1 deletion docker/kube/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ data:
index index.php index.html index.htm index.nginx-debian.html;
proxy_cache_valid 200 365d;
charset utf-8;
real_ip_header CF-Connecting-IP;
if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
Expand Down Expand Up @@ -150,7 +151,7 @@ metadata:
name: php-deployment-dashboard
namespace: general-namespace
spec:
replicas: 2
replicas: 4
selector:
matchLabels:
app: php-basic-dashboard
Expand All @@ -164,6 +165,15 @@ spec:
image: petertharwat/php-fpm-8.3-github:v1.0.6
ports:
- containerPort: 9000
readinessProbe:
exec:
command:
- /bin/sh
- -c
- php /var/www/html/site/artisan migrate:status || exit 1
initialDelaySeconds: 5
periodSeconds: 10
failureThreshold: 3
env:
- name: REPO_URL
valueFrom:
Expand Down

0 comments on commit 5734e4d

Please sign in to comment.