35 Commits

Author SHA1 Message Date
Jp
993d096283 test 2026-02-26 14:02:41 +08:00
Jp
08817af0ca test 2026-02-26 14:00:19 +08:00
Jp
afb7cefdda test 2026-02-26 13:56:10 +08:00
Jp
08fe589ad6 test 2026-02-26 13:54:47 +08:00
Jp
1937e26251 test 2026-02-26 13:46:33 +08:00
Jp
1dbc32722a chore: improve container build and deployment configuration
- Add common system directories to .dockerignore to prevent accidental inclusion
- Reorder Dockerfile instructions for better clarity and performance
- Remove remote deployment targets from Makefile to simplify local development workflow
2026-02-26 13:44:36 +08:00
Jp
a4124ceaa9 test 2026-02-26 13:42:31 +08:00
Jp
8b23298196 test 2026-02-26 13:39:45 +08:00
Jp
3c251e9c3a test 2026-02-26 13:36:40 +08:00
Jp
f635dabbc5 test 2026-02-26 13:34:20 +08:00
Jp
e0f459f9ea refactor(Dockerfile): simplify image build and permission handling
- Use fully qualified image names for clarity
- Remove manual PHP extension installation as base image likely includes them
- Leverage COPY --chown to set permissions directly
- Remove redundant permission fix commands
- Keep same final command and exposed port
2026-02-26 13:33:07 +08:00
Jp
8c414e7e70 build: switch to thecodingmachine PHP image for enhanced features
The base image is changed from the official php:8.4-fpm-alpine to thecodingmachine/php:8.4-v4-fpm-alpine to leverage additional pre-installed extensions, configurations, and utilities provided by the TheCodingMachine Docker images, which simplifies the setup for common PHP development and production environments.
2026-02-26 13:31:46 +08:00
Jp
49226f8aa1 build: simplify Dockerfile using extension installer
- Replace manual apk install and docker-php-ext-install with mlocati/docker-php-extension-installer
- Combine system dependency installation and PHP extension setup into a single step
- Reorder steps for better clarity: copy files before permission fixes
- Maintain same PHP extensions and final permissions
2026-02-26 13:27:58 +08:00
Jp
77ed347e36 build: switch to Alpine base image and simplify Dockerfile
- Use php:8.4-fpm-alpine for smaller image size
- Replace apt-get with apk package manager
- Use docker-php-ext-install instead of external extension installer
- Remove unnecessary comments and clean up cache appropriately
2026-02-26 13:17:33 +08:00
Jp
4ade74421c chore(docker): switch to mlocati's PHP extension installer
The docker-php-ext-install command can have permission issues on some
remote servers when extracting tarballs. Using mlocati/docker-php-extension-installer
provides a more reliable method for installing PHP extensions in Docker
containers.
2026-02-26 12:54:55 +08:00
Jp
8e3913bda8 fix(Dockerfile): replace php extension installer with docker-php-ext-install
The third-party extension installer (mlocati/docker-php-extension-installer) was causing tar permission issues on the remote server. Using the standard `docker-php-ext-install` method resolves this compatibility problem.
2026-02-26 11:44:16 +08:00
Jp
fea727daf4 ci(Docker): add --cleanup flag to install-php-extensions
Add the --cleanup flag to the install-php-extensions command to remove downloaded archives after installation, reducing the final image size.

Use the --no-cache flag for the remote podman build in the deployment script to ensure a clean build from the latest source on the server.
2026-02-26 11:36:50 +08:00
Jp
cea2749252 ci: build image remotely before deploying to server
Previously the image was built locally and pushed to a registry. Now we build directly on the remote server to simplify the deployment flow and avoid registry dependencies.
2026-02-26 11:34:48 +08:00
Jp
5992b28eb5 ci: use rm -f to avoid errors when cleaning up temporary files
The -f flag prevents errors if the files do not exist, ensuring the cleanup step is robust and does not fail the deployment process.
2026-02-26 11:30:32 +08:00
Jp
e6acea80a0 chore(deploy): prepend sudo to kubectl commands in Makefile
Ensure kubectl commands have necessary permissions when generating ConfigMaps during deployment.
2026-02-26 11:29:03 +08:00
Jp
02dbea230c fix(deploy): add sudo to kubectl apply command for proper permissions
The deploy-server target was failing due to insufficient permissions on the remote server. Adding sudo ensures kubectl can apply the deployment configuration.
2026-02-26 11:27:10 +08:00
Jp
07748a7025 chore(Makefile): update server config and improve deployment scripts
- Update default server user, IP, and deployment path to match current environment
- Redirect podman kube down output to /dev/null to reduce noise
- Use /tmp directory for temporary YAML files to avoid WSL permission issues
- Consolidate deployment steps to reduce password prompts during remote deployment
2026-02-26 11:25:54 +08:00
Jp
55d2f61d09 ci: streamline server deployment by reducing SSH prompts
Generate a temporary merged YAML file locally before copying to the server. This reduces the number of SSH/SCP commands from multiple to two, minimizing password prompts and connection overhead.
2026-02-26 11:23:30 +08:00
Jp
aef00b405a chore: remove redundant .env copy commands from deploy targets
The .env file is now expected to be present before running deploy commands. This simplifies the Makefile by removing conditional copy logic that was causing confusion about environment setup.
2026-02-26 11:19:19 +08:00
Jp
ac41090ed3 feat(Makefile): add remote server deployment target
Add deploy-server target to deploy application to a remote Kubernetes cluster.
Includes server configuration variables and uses scp/ssh for file transfer and
kubectl commands for applying configuration and deployment.
2026-02-26 11:14:39 +08:00
Jp
ba9c80b9b4 fix(Dockerfile): set proper permissions and remove CI directories
The previous COPY instruction with --chown flag was not recursively setting permissions. Explicitly set directory and file permissions for the www-data user and remove unnecessary CI directories to reduce image size and potential security exposure.
2026-02-26 11:08:20 +08:00
Jp
618f826e1e ci: improve deployment script verbosity and error handling
- Remove stderr suppression from podman kube down to show potential errors
- Remove @ prefix from kubectl command to show execution in output
- Add comment clarifying the purpose of removing stderr redirection
2026-02-26 11:06:21 +08:00
Jp
baf68078a7 ci: switch from Kubernetes to Podman for local deployment
- Update Dockerfile to use fully qualified composer image name
- Replace kubectl commands with podman kube play/down in Makefile
- Change from Kubernetes Secret to ConfigMap for environment variables
- Set imagePullPolicy to Never and use localhost/ prefix for local images
- Reduce replica count to 1 for local development
- Add stop target to Makefile for easier cleanup
2026-02-26 10:55:30 +08:00
Jp
87fd507618 chore(docker): move WORKDIR declaration earlier and reorder steps
Set working directory before copying files to avoid potential conflicts with host files. Also reorder Dockerfile steps for better logical flow and maintainability.
2026-02-25 22:52:20 +08:00
Jp
a697100103 chore(docker): ignore CI directories and use extension installer
- Add .github and .circleci to .dockerignore to reduce image size
- Replace docker-php-ext-install with mlocati's extension installer for better reliability and maintenance
2026-02-25 22:43:35 +08:00
Jp
dd188724be build(docker): enhance Docker setup with proper dependencies and structure
- Add comprehensive .dockerignore file to exclude unnecessary files
- Update Dockerfile to install required system dependencies and PHP extensions
- Set proper working directory and user permissions
- Use multi-stage build for Composer installation
2026-02-25 22:34:05 +08:00
95301dc1d8 Merge pull request #10 from kingjaypee12/jp/deployment
chore: migrate from docker compose to kubernetes deployment
2026-02-25 22:06:17 +08:00
Jp
673a6ce166 chore: migrate from docker compose to kubernetes deployment
- Replace Docker Compose setup with Kubernetes manifests for deployment
- Simplify Dockerfile to use PHP's built-in server instead of nginx+supervisor
- Add Makefile with build and deploy commands for local development
- Update environment configuration for production deployment
- Remove docker-specific configuration files (nginx.conf, supervisord.conf)
2026-02-25 22:05:41 +08:00
Jp
e57e6d3413 feat(docker): add standalone Docker setup and remove docker-compose
- Replace Laravel Sail docker-compose with a single-container Dockerfile
- Configure nginx and PHP-FPM via supervisor for production-like environment
- Include optimized PHP extensions and Redis support
- Simplify deployment by removing multi-service orchestration
2026-02-19 16:33:03 +08:00
Jp
feba3f1464 style: remove unnecessary !important from CSS utility classes
The !important flag was previously used to override Tailwind's default styles, but it is no longer needed after recent framework updates. This change improves maintainability and follows CSS best practices by avoiding excessive specificity.
2026-02-19 03:18:00 +08:00
7 changed files with 172 additions and 67 deletions

17
.dockerignore Normal file
View File

@@ -0,0 +1,17 @@
.git
.github
.circleci
.env
.env.local
node_modules
vendor
storage/logs/*
storage/framework/cache/*
bootstrap/cache/*
.phpunit.result.cache
.idea
.vscode
.devcontainer
docker-compose.yml
Makefile
k8s/

View File

@@ -1,9 +1,9 @@
APP_NAME=Laravel APP_NAME='MKM Tax Services'
APP_ENV=local APP_ENV=local
APP_KEY= APP_KEY=base64:Tqv7x1T7GGUVfwzcWOwg6fwrp96dkjV4WCgyRYjdyYY=
APP_DEBUG=true APP_DEBUG=true
APP_TIMEZONE=UTC APP_TIMEZONE=UTC
APP_URL=http://localhost APP_URL=http://mkmtaxservices.com.test
APP_LOCALE=en APP_LOCALE=en
APP_FALLBACK_LOCALE=en APP_FALLBACK_LOCALE=en
@@ -20,11 +20,14 @@ LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug LOG_LEVEL=debug
DB_CONNECTION=mysql DB_CONNECTION=mysql
DB_HOST=127.0.0.1 DB_HOST=192.168.100.105
DB_PORT=3306 DB_PORT=3306
DB_DATABASE=mkm_admin DB_DATABASE=mkm_admin
DB_USERNAME=root DB_USERNAME=root
DB_PASSWORD= DB_PASSWORD=root
DB_QUEUE_TABLE=jobs
DB_QUEUE=default
SESSION_DRIVER=database SESSION_DRIVER=database
SESSION_LIFETIME=120 SESSION_LIFETIME=120
@@ -42,12 +45,12 @@ CACHE_PREFIX=
MEMCACHED_HOST=127.0.0.1 MEMCACHED_HOST=127.0.0.1
REDIS_CLIENT=phpredis REDIS_CLIENT=phpredis
REDIS_HOST=127.0.0.1 REDIS_HOST=192.168.100.105
REDIS_PASSWORD=null REDIS_PASSWORD=null
REDIS_PORT=6379 REDIS_PORT=6379
MAIL_MAILER=log MAIL_MAILER=log
MAIL_HOST=127.0.0.1 MAIL_HOST=192.168.100.105
MAIL_PORT=2525 MAIL_PORT=2525
MAIL_USERNAME=null MAIL_USERNAME=null
MAIL_PASSWORD=null MAIL_PASSWORD=null
@@ -62,3 +65,5 @@ AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false AWS_USE_PATH_STYLE_ENDPOINT=false
VITE_APP_NAME="${APP_NAME}" VITE_APP_NAME="${APP_NAME}"
OCTANE_SERVER=frankenphp

40
Dockerfile Normal file
View File

@@ -0,0 +1,40 @@
FROM docker.io/alpine:3.21
RUN apk add --no-cache \
php84 \
php84-fpm \
php84-pdo_mysql \
php84-mbstring \
php84-exif \
php84-pcntl \
php84-bcmath \
php84-gd \
php84-zip \
php84-intl \
php84-curl \
php84-tokenizer \
php84-xml \
php84-xmlwriter \
php84-xmlreader \
php84-dom \
php84-session \
php84-fileinfo \
php84-openssl \
git \
curl
RUN ln -sf /usr/bin/php84 /usr/bin/php
WORKDIR /var/www
# Copy the application files
COPY --chown=root:root . .
COPY --from=docker.io/composer:latest /usr/bin/composer /usr/bin/composer
RUN rm -rf .circleci .github 2>/dev/null || true && \
chmod -R 775 storage bootstrap/cache 2>/dev/null || true
EXPOSE 8000
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]

21
Makefile Normal file
View File

@@ -0,0 +1,21 @@
IMG := mkm-admin
build:
@echo "Building image from project root..."
podman build -t $(IMG) .
deploy: build
@echo "Cleaning up existing deployment if any..."
-podman kube down k8s/deployment.yaml >/dev/null 2>&1
@echo "Generating merged deployment with ConfigMap..."
@sudo kubectl create configmap mkm-admin-config --from-env-file=.env --dry-run=client -o yaml > /tmp/merged_deployment.yaml
@echo "---" >> /tmp/merged_deployment.yaml
@cat k8s/deployment.yaml >> /tmp/merged_deployment.yaml
@echo "Deploying via podman kube play..."
podman kube play /tmp/merged_deployment.yaml
@rm -f /tmp/merged_deployment.yaml
stop:
-podman kube down k8s/deployment.yaml >/dev/null 2>&1
.PHONY: build deploy stop

View File

@@ -1,58 +0,0 @@
services:
laravel.test:
build:
context: ./vendor/laravel/sail/runtimes/8.3
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.3/app
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${APP_PORT:-80}:80'
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
environment:
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
IGNITION_LOCAL_SITES_PATH: '${PWD}'
SUPERVISOR_PHP_COMMAND: "/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan octane:start --server=frankenphp --host=0.0.0.0 --admin-port=2019 --port=80"
XDG_CONFIG_HOME: /var/www/html/config
XDG_DATA_HOME: /var/www/html/data
volumes:
- '.:/var/www/html'
networks:
- sail
depends_on:
- mysql
mysql:
image: 'mysql/mysql-server:8.0'
ports:
- '${FORWARD_DB_PORT:-3306}:3306'
environment:
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
MYSQL_ROOT_HOST: '%'
MYSQL_DATABASE: '${DB_DATABASE}'
MYSQL_USER: '${DB_USERNAME}'
MYSQL_PASSWORD: '${DB_PASSWORD}'
MYSQL_ALLOW_EMPTY_PASSWORD: 1
volumes:
- 'sail-mysql:/var/lib/mysql'
- './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
networks:
- sail
healthcheck:
test:
- CMD
- mysqladmin
- ping
- '-p${DB_PASSWORD}'
retries: 3
timeout: 5s
networks:
sail:
driver: bridge
volumes:
sail-mysql:
driver: local

80
k8s/deployment.yaml Normal file
View File

@@ -0,0 +1,80 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mkm-admin
labels:
app: mkm-admin
spec:
replicas: 1
selector:
matchLabels:
app: mkm-admin
template:
metadata:
labels:
app: mkm-admin
spec:
containers:
- name: mkm-admin
image: localhost/mkm-admin:latest
imagePullPolicy: Never
ports:
- containerPort: 8000
envFrom:
- configMapRef:
name: mkm-admin-config
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: localhost/mkm-admin:latest
imagePullPolicy: Never
command: ["php", "artisan", "horizon"]
envFrom:
- configMapRef:
name: mkm-admin-config
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

View File

@@ -1,11 +1,11 @@
@import "tailwindcss"; @import "tailwindcss";
.fi-btn , .fi-input-wrp, .fi-tabs, .fi-sidebar-item-button { .fi-btn , .fi-input-wrp, .fi-tabs, .fi-sidebar-item-button {
@apply rounded-sm !important; @apply rounded-sm;
} }
.fi-tabs { .fi-tabs {
@apply mx-0 rounded-sm !important; @apply mx-0 rounded-sm;
} }
.fi-resource-relation-managers { .fi-resource-relation-managers {