diff --git a/.env.example b/.env.example index 1159015..9e5d631 100644 --- a/.env.example +++ b/.env.example @@ -1,9 +1,9 @@ -APP_NAME=Laravel +APP_NAME='MKM Tax Services' APP_ENV=local -APP_KEY= +APP_KEY=base64:Tqv7x1T7GGUVfwzcWOwg6fwrp96dkjV4WCgyRYjdyYY= APP_DEBUG=true APP_TIMEZONE=UTC -APP_URL=http://localhost +APP_URL=http://mkmtaxservices.com.test APP_LOCALE=en APP_FALLBACK_LOCALE=en @@ -20,11 +20,14 @@ LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug DB_CONNECTION=mysql -DB_HOST=127.0.0.1 +DB_HOST=192.168.100.105 DB_PORT=3306 DB_DATABASE=mkm_admin DB_USERNAME=root -DB_PASSWORD= +DB_PASSWORD=root + +DB_QUEUE_TABLE=jobs +DB_QUEUE=default SESSION_DRIVER=database SESSION_LIFETIME=120 @@ -42,12 +45,12 @@ CACHE_PREFIX= MEMCACHED_HOST=127.0.0.1 REDIS_CLIENT=phpredis -REDIS_HOST=127.0.0.1 +REDIS_HOST=192.168.100.105 REDIS_PASSWORD=null REDIS_PORT=6379 MAIL_MAILER=log -MAIL_HOST=127.0.0.1 +MAIL_HOST=192.168.100.105 MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null @@ -62,3 +65,5 @@ AWS_BUCKET= AWS_USE_PATH_STYLE_ENDPOINT=false VITE_APP_NAME="${APP_NAME}" + +OCTANE_SERVER=frankenphp diff --git a/Dockerfile b/Dockerfile index 4260b97..f6cdc77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,6 @@ FROM php:8.4-fpm -WORKDIR /var/www +COPY . /app +WORKDIR /app -RUN apt-get update && apt-get install -y \ - git curl zip unzip libpng-dev libonig-dev \ - libxml2-dev nginx supervisor \ - && docker-php-ext-install pdo pdo_mysql mbstring exif pcntl bcmath gd - -RUN pecl install redis && docker-php-ext-enable redis - -COPY --from=composer:latest /usr/bin/composer /usr/bin/composer - -COPY . . - -RUN composer install --no-dev --optimize-autoloader - -COPY docker/nginx.conf /etc/nginx/nginx.conf -COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf - -RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache -RUN chmod -R 775 /var/www/storage /var/www/bootstrap/cache - -EXPOSE 80 -CMD ["/usr/bin/supervisord"] \ No newline at end of file +CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..acdcfbe --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +IMG := mkm-admin + +build: + podman build -t $(IMG) . + +deploy: build + @if [ ! -f .env ]; then cp .env.example .env; fi + kubectl create secret generic mkm-admin-env --from-env-file=.env --dry-run=client -o yaml | kubectl apply -f - + kubectl apply -f k8s/deployment.yaml + +.PHONY: build deploy diff --git a/docker/nginx.conf b/docker/nginx.conf deleted file mode 100644 index 56642a2..0000000 --- a/docker/nginx.conf +++ /dev/null @@ -1,24 +0,0 @@ -events {} - -http { - include mime.types; - server { - listen 80; - root /var/www/public; - index index.php; - - location / { - try_files $uri $uri/ /index.php?$query_string; - } - - location ~ \.php$ { - fastcgi_pass 127.0.0.1:9000; - fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; - include fastcgi_params; - } - - location ~ /\.ht { - deny all; - } - } -} \ No newline at end of file diff --git a/docker/supervisord.conf b/docker/supervisord.conf deleted file mode 100644 index b2455ad..0000000 --- a/docker/supervisord.conf +++ /dev/null @@ -1,12 +0,0 @@ -[supervisord] -nodaemon=true - -[program:php-fpm] -command=php-fpm -autostart=true -autorestart=true - -[program:nginx] -command=nginx -g 'daemon off;' -autostart=true -autorestart=true \ No newline at end of file diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml new file mode 100644 index 0000000..38fe360 --- /dev/null +++ b/k8s/deployment.yaml @@ -0,0 +1,80 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mkm-admin + labels: + app: mkm-admin +spec: + replicas: 3 + selector: + matchLabels: + app: mkm-admin + template: + metadata: + labels: + app: mkm-admin + spec: + containers: + - name: mkm-admin + image: mkm-admin:latest + imagePullPolicy: Always + ports: + - containerPort: 8000 + envFrom: + - secretRef: + name: mkm-admin-env + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "500m" + memory: "512Mi" +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mkm-admin-worker + labels: + app: mkm-admin + component: worker +spec: + replicas: 1 + selector: + matchLabels: + app: mkm-admin + component: worker + template: + metadata: + labels: + app: mkm-admin + component: worker + spec: + containers: + - name: worker + image: mkm-admin:latest + imagePullPolicy: Always + command: ["php", "artisan", "horizon"] + envFrom: + - secretRef: + name: mkm-admin-env + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "500m" + memory: "512Mi" +--- +apiVersion: v1 +kind: Service +metadata: + name: mkm-admin-service +spec: + selector: + app: mkm-admin + ports: + - protocol: TCP + port: 80 + targetPort: 8000 + type: ClusterIP