Compare commits

...

45 Commits

Author SHA1 Message Date
Frank John Begornia
678a8842f4 Add entrypoint script and update Dockerfile for proper initialization; modify Traefik labels for production environment
All checks were successful
Deploy Production (admin.merchbay.app) / deploy (push) Successful in 2m42s
2025-12-21 05:06:11 +08:00
Frank John Begornia
4ce000e95b Add development and production Docker Compose files; update deployment scripts to use new file names
All checks were successful
Deploy Production (admin.merchbay.app) / deploy (push) Successful in 2m43s
2025-12-21 04:56:21 +08:00
Frank John Begornia
cc882ea6fc Stop and remove existing containers before starting new ones in deployment script
All checks were successful
Deploy Production (admin.merchbay.app) / deploy (push) Successful in 2m20s
2025-12-21 04:48:09 +08:00
Frank John Begornia
ee557c6fd2 Update deployment directory path in deploy script
Some checks failed
Deploy Production (admin.merchbay.app) / deploy (push) Failing after 1m41s
2025-12-21 04:43:47 +08:00
Frank John Begornia
e17ac2af1f Update deployment directory permissions and ownership in deploy script
Some checks failed
Deploy Production (admin.merchbay.app) / deploy (push) Failing after 1m40s
2025-12-21 04:41:15 +08:00
Frank John Begornia
ab0be021e1 Update deployment directory to point to production path for merchbay_admin
Some checks failed
Deploy Production (admin.merchbay.app) / deploy (push) Failing after 1m45s
2025-12-21 04:37:52 +08:00
Frank John Begornia
5fbaf0767e Remove unnecessary migration and route cache commands from deployment script
All checks were successful
Deploy Production (admin.merchbay.app) / deploy (push) Successful in 2m20s
2025-12-21 04:29:24 +08:00
Frank John Begornia
5707e3debb Update deployment directory to use development path for merchbay_admin
Some checks failed
Deploy Production (admin.merchbay.app) / deploy (push) Failing after 2m2s
2025-12-21 04:26:03 +08:00
Frank John Begornia
2c4b110f33 Refactor deployment workflow to improve SSH setup, streamline artifact upload, and enhance health check process
Some checks failed
Deploy Production (admin.merchbay.app) / deploy (push) Failing after 1m48s
2025-12-21 04:22:00 +08:00
Frank John Begornia
5b12eb2072 Merge branch 'dev'
Some checks failed
Deploy Production (admin.merchbay.app) / deploy (push) Failing after 1m57s
2025-12-21 04:15:54 +08:00
Frank John Begornia
7a559a9021 Refactor deployment script to streamline SSH setup and enhance Docker cleanup processes
Some checks failed
Deploy Development / deploy (push) Has been cancelled
2025-12-21 04:09:42 +08:00
Frank John Begornia
1c29fbf958 Update deployment workflow to use environment-specific variables and enhance application URL references
All checks were successful
Deploy Development / deploy (push) Successful in 2m45s
2025-12-21 04:02:00 +08:00
Frank John Begornia
7c4650f83b Enhance Docker cleanup in deployment workflows to reclaim space and improve resource management
All checks were successful
Deploy Development / deploy (push) Successful in 5m57s
2025-12-18 15:03:33 +08:00
Frank John Begornia
39abf1b5fc Enhance deployment workflows to remove old Docker images and prune unused resources
All checks were successful
Deploy Development / deploy (push) Successful in 6m31s
2025-12-18 14:53:13 +08:00
Frank John Begornia
e45cfb5ebd Update deployment scripts to specify required environment variables in .env file and docker-compose
All checks were successful
Deploy Development / deploy (push) Successful in 2m11s
2025-12-18 13:13:24 +08:00
Frank John Begornia
246f6b2c0f Remove outdated deployment and configuration files; consolidate deployment instructions into README and update project structure.
All checks were successful
Deploy Development / deploy (push) Successful in 1m20s
2025-12-18 12:58:56 +08:00
Frank John Begornia
075c6bfdf9 Fix typo in AppServiceProvider to use forceSchema instead of forceScheme
All checks were successful
Deploy Development / deploy (push) Successful in 2m11s
2025-12-18 12:31:11 +08:00
Frank John Begornia
58e1bad1cf Enhance AppServiceProvider to force HTTPS when behind a proxy
Some checks failed
Deploy Development / deploy (push) Failing after 2m14s
2025-12-18 12:24:02 +08:00
Frank John Begornia
110c0f7291 Fix: Create storage directories and set proper permissions
All checks were successful
Deploy Development / deploy (push) Successful in 2m18s
2025-12-18 12:14:14 +08:00
Frank John Begornia
2550a945a3 Enhance health check in deployment workflow and suppress Apache ServerName warning in Dockerfile
Some checks failed
Deploy Development / deploy (push) Failing after 2m14s
2025-12-18 11:44:41 +08:00
Frank John Begornia
159dda3843 Enhance deployment script to clear and rebuild config cache for improved performance
Some checks failed
Deploy Development / deploy (push) Failing after 2m3s
2025-12-18 11:30:35 +08:00
Frank John Begornia
946f968ca0 Add cache clearing step during deployment to optimize application performance
Some checks failed
Deploy Development / deploy (push) Failing after 2m4s
2025-12-18 11:26:29 +08:00
Frank John Begornia
58e36c420c Fix .env permissions to ensure proper access during deployment
Some checks failed
Deploy Development / deploy (push) Failing after 57s
2025-12-18 11:19:14 +08:00
Frank John Begornia
7fb6a74a13 Add .env.example file and update docker-compose configurations for environment variables
Some checks failed
Deploy Development / deploy (push) Failing after 1m40s
2025-12-18 11:15:29 +08:00
Frank John Begornia
183d19848b Update artifact upload paths in deployment workflow for accuracy
Some checks failed
Deploy Development / deploy (push) Failing after 1m43s
2025-12-16 15:42:22 +08:00
Frank John Begornia
f2081217af Refactor deployment workflow to streamline SSH setup and improve image building process
Some checks failed
Deploy Development / deploy (push) Failing after 1m19s
2025-12-16 15:38:36 +08:00
Frank John Begornia
e9620052f7 Update deployment directory path in workflow from /home/deploy/apps to /var/www/apps for consistency
Some checks failed
Deploy Development / deploy (push) Failing after 1m32s
2025-12-16 15:23:01 +08:00
Frank John Begornia
3ca2983c68 Refactor secrets debug step in deployment workflow for clarity and efficiency
Some checks failed
Deploy Development / deploy (push) Failing after 1m25s
2025-12-16 15:14:48 +08:00
Frank John Begornia
676988fabb Update deployment paths in workflow and remove versioning from docker-compose
Some checks failed
Deploy Development / deploy (push) Failing after 55s
2025-12-16 14:58:43 +08:00
Frank John Begornia
73b178fa2c Enhance deployment workflow by adding SSH setup and secret validation checks for improved security and reliability
Some checks failed
Deploy Development / deploy (push) Failing after 41s
2025-12-16 14:24:11 +08:00
Frank John Begornia
8e8bfd1897 Refactor SSH setup in deployment workflow to enhance secrets presence checks and improve output clarity
Some checks failed
Deploy Development / deploy (push) Failing after 1m17s
2025-12-16 14:16:30 +08:00
Frank John Begornia
aaa043f06e Enhance SSH setup in deployment workflow to include error handling for empty SSH key
Some checks failed
Deploy Development / deploy (push) Failing after 28s
2025-12-16 14:04:01 +08:00
Frank John Begornia
74860f8a0d Fix SSH key variable in deployment workflow for consistency and security
Some checks failed
Deploy Development / deploy (push) Failing after 1m17s
2025-12-16 14:00:23 +08:00
Frank John Begornia
9d0bae2dea Refactor deployment workflow by removing unnecessary input parameters and enhancing SSH setup for improved security and reliability
Some checks failed
Deploy Development / deploy (push) Failing after 1m20s
2025-12-16 13:57:04 +08:00
Frank John Begornia
63c5c50578 Update domain and application URL to dev-admin.merchbay.app across deployment configurations
Some checks failed
Deploy Development / deploy (push) Failing after 1m18s
2025-12-16 13:33:09 +08:00
Frank John Begornia
632f143637 Refactor SSH setup in deployment workflows to enhance security and error handling
Some checks failed
Deploy Development / deploy (push) Failing after 1m20s
2025-12-16 13:22:35 +08:00
Frank John Begornia
a4171330e5 Enhance deployment workflows with additional input parameters and setup scripts
Some checks failed
Deploy Development / deploy (push) Has been cancelled
2025-12-16 13:18:29 +08:00
Frank John Begornia
af0d8cd9ac Add container specification and shell definitions to deployment workflows
Some checks failed
Deploy Development / deploy (push) Failing after 4m25s
2025-12-13 02:58:29 +08:00
Frank John Begornia
fa59a081d8 Refactor deployment workflows to enhance SSH handling and streamline Docker image deployment
Some checks failed
Deploy Development / deploy (push) Failing after 2s
2025-12-12 01:39:37 +08:00
Frank John Begornia
6f7b81f1da Refactor deployment scripts to use GitHub environment variables and improve SSH key handling 2025-12-12 01:37:27 +08:00
Frank John Begornia
a12ee2e5aa Refactor deployment workflows to streamline code checkout and file transfer processes
Some checks failed
Deploy Development / deploy (push) Failing after 2s
2025-12-12 01:36:14 +08:00
Frank John Begornia
c72e03f282 Update domain references from merchbay.app to merchbay.com in configuration files
Some checks failed
Deploy Development / deploy (push) Failing after 5s
2025-12-12 01:34:05 +08:00
Frank John Begornia
0cedc90031 Add CI/CD workflows for development and production deployments
Some checks failed
Deploy Development / deploy (push) Failing after 29s
- Created `deploy-dev.yml` for automated deployment to the development server on push to the `dev` branch.
- Created `deploy.yml` for automated deployment to the production server on push to the `main` or `master` branches.
- Added deployment instructions in `DEPLOYMENT-PORTAINER.md` for using Portainer and Traefik.
- Documented Gitea Actions deployment process in `DEPLOYMENT.md`.
- Configured Traefik SSL settings in `TRAEFIK-SSL-CONFIG.md` for both development and production environments.
- Implemented a deployment script `deploy.sh` for manual deployments.
- Added Docker Compose configurations for development (`docker-compose.portainer.dev.yml`) and production (`docker-compose.portainer.yml`) environments.
- Updated main `docker-compose.yml` to support Traefik integration and environment variable configurations.
2025-12-12 01:24:50 +08:00
a6b2ea3a14 Merge pull request 'add Docker configuration files and deployment guide' (#1) from feat/docker-config into dev
Reviewed-on: #1
2025-12-11 17:09:14 +00:00
Frank John Begornia
b5443ddcee add Docker configuration files and deployment guide 2025-12-12 01:06:06 +08:00
6 changed files with 244 additions and 53 deletions

View File

@@ -51,7 +51,7 @@ jobs:
run: |
scp -i ~/.ssh/id_ed25519 \
/workspace/repo/merchbay_admin_dev.tar.gz \
/workspace/repo/docker-compose.yml \
/workspace/repo/docker-compose.dev.yml \
${DEPLOY_USER}@${DEPLOY_HOST}:/tmp/
# 5⃣ Deploy on server
@@ -75,7 +75,7 @@ jobs:
docker images | grep merchbay_admin | grep -v "$(docker images merchbay_admin:dev -q)" | awk '{print $3}' | xargs -r docker rmi -f || true
echo "📄 Updating compose file"
cp /tmp/docker-compose.yml "$DEPLOY_DIR/"
cp /tmp/docker-compose.dev.yml "$DEPLOY_DIR/docker-compose.yml"
cd "$DEPLOY_DIR"
@@ -114,7 +114,7 @@ jobs:
fi
echo "🧹 Cleanup"
rm -f /tmp/merchbay_admin_dev.tar.gz /tmp/docker-compose.yml
rm -f /tmp/merchbay_admin_dev.tar.gz /tmp/docker-compose.dev.yml
echo "🧹 Aggressive Docker cleanup to reclaim space"
docker image prune -af --filter "until=24h" || true

View File

@@ -12,82 +12,158 @@ jobs:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
# 1⃣ Checkout code
- name: Checkout code
shell: sh
run: |
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git /workspace/repo || true
git clone $GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git /workspace/repo
cd /workspace/repo
git fetch origin $GITHUB_REF_NAME
git checkout $GITHUB_REF_NAME
git pull origin $GITHUB_REF_NAME
- name: Build Docker Image
# 2⃣ Build image
- name: Build Docker image
shell: sh
run: |
cd /workspace/repo
docker build -t merchbay_admin:latest .
docker save merchbay_admin:latest | gzip > merchbay_admin.tar.gz
- name: Setup SSH and Deploy
# 3⃣ Setup SSH
- name: Setup SSH
shell: sh
env:
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
run: |
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "$DEPLOY_SSH_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keygen -y -f ~/.ssh/deploy_key > /dev/null 2>&1 || { echo "Error: Invalid SSH key format"; exit 1; }
cd /workspace/repo
scp -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key merchbay_admin.tar.gz docker-compose.yml "$DEPLOY_USER@$DEPLOY_HOST:/tmp/"
ssh -o StrictHostKeyChecking=no -i ~/.ssh/deploy_key "$DEPLOY_USER@$DEPLOY_HOST" "
DEPLOY_DIR='/var/www/merchbay_admin'
mkdir -p \$DEPLOY_DIR
cd /tmp
docker load < merchbay_admin.tar.gz
echo 'Removing old merchbay_admin images'
docker images | grep merchbay_admin | grep -v "\$(docker images merchbay_admin:latest -q)" | awk '{print \$3}' | xargs -r docker rmi -f || true
cp docker-compose.yml \$DEPLOY_DIR/
cd \$DEPLOY_DIR
# .env file should already exist on server with all required variables
# Required: DB_*, IMAGES_DIRECTORY, PRODUCTION_PRIVATE_SERVER
# If it doesn't exist, deployment will fail (this is intentional for security)
echo "$DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts
# 4⃣ Upload artifacts
- name: Upload image and compose
shell: sh
env:
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
run: |
scp -i ~/.ssh/id_ed25519 \
/workspace/repo/merchbay_admin.tar.gz \
/workspace/repo/docker-compose.prod.yml \
${DEPLOY_USER}@${DEPLOY_HOST}:/tmp/
# 5⃣ Deploy on server
- name: Deploy on server
shell: sh
env:
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
run: |
ssh -i ~/.ssh/id_ed25519 $DEPLOY_USER@$DEPLOY_HOST << 'EOF'
set -e
DEPLOY_DIR="/var/www/apps/merchbay_admin"
sudo mkdir -p "$DEPLOY_DIR"
sudo chown $USER:$USER "$DEPLOY_DIR"
echo "📦 Loading image"
docker load < /tmp/merchbay_admin.tar.gz
echo "🧹 Removing old merchbay_admin images"
docker images | grep merchbay_admin | grep -v "$(docker images merchbay_admin:latest -q)" | awk '{print $3}' | xargs -r docker rmi -f || true
echo "📄 Updating compose file"
cp /tmp/docker-compose.prod.yml "$DEPLOY_DIR/docker-compose.yml"
cd "$DEPLOY_DIR"
echo "🔍 Checking .env file"
if [ ! -f .env ]; then
echo "❌ .env file not found at $DEPLOY_DIR/.env"
echo "Please create it first with required variables:"
echo " - DB_*, IMAGES_DIRECTORY, PRODUCTION_PRIVATE_SERVER"
exit 1
fi
echo "🔧 Fixing .env permissions"
sudo chown $USER:$USER .env
sudo chmod 600 .env
echo "🌐 Ensure networks"
docker network inspect traefik-public >/dev/null 2>&1 || \
docker network create traefik-public
docker network inspect crew-app-net >/dev/null 2>&1 || \
docker network create crew-app-net
echo "<22> Stopping and removing existing containers"
docker compose down || true
docker image prune -f
docker network inspect traefik-public >/dev/null 2>&1 || docker network create traefik-public
docker network inspect crew-app-net >/dev/null 2>&1 || docker network create crew-app-net
export DOMAIN=admin.merchbay.app
export APP_URL=https://admin.merchbay.app
docker rm -f merchbay_admin_app || true
echo "<22>🚀 Starting containers (env vars from .env file)"
docker compose up -d
sleep 10
docker compose exec -T app php artisan config:cache
docker compose exec -T app php artisan route:cache
rm -f /tmp/merchbay_admin.tar.gz /tmp/docker-compose.yml
echo "⏳ Waiting for app container"
sleep 15
if docker ps --format '{{.Names}}' | grep -q merchbay_admin_app; then
echo "🧹 Running migrations and clearing caches"
docker compose exec -T app php artisan config:clear
docker compose exec -T app php artisan config:cache
else
echo "❌ App container not running"
docker compose logs
exit 1
fi
echo "🧹 Cleanup"
rm -f /tmp/merchbay_admin.tar.gz /tmp/docker-compose.prod.yml
echo 'Aggressive Docker cleanup to reclaim space'
echo "🧹 Aggressive Docker cleanup to reclaim space"
docker image prune -af --filter "until=24h" || true
docker container prune -f || true
docker volume prune -f || true
docker builder prune -af --filter "until=48h" || true
echo 'Docker space usage:'
echo "📊 Docker space usage:"
docker system df
echo 'Production deployment completed successfully!'
echo 'Application available at: https://admin.merchbay.app'
"
env:
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
rm -f /tmp/merchbay_admin.tar.gz /tmp/docker-compose.prod.yml
- name: Health Check
echo "✅ Production deployment completed!"
echo "🌐 Application available at: https://admin.merchbay.app"
EOF
# 6⃣ Health check
- name: Health check
shell: sh
run: |
sleep 10
curl -f https://admin.merchbay.app || exit 1
echo "⏳ Waiting for app to be ready..."
sleep 20
echo "🔍 Testing health check (ignoring SSL cert for now)..."
HTTP_CODE=$(curl -k -s -o /dev/null -w "%{http_code}" --max-time 30 https://admin.merchbay.app || echo "000")
if [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "302" ] || [ "$HTTP_CODE" = "301" ]; then
echo "✅ Health check passed! (HTTP $HTTP_CODE)"
echo "🎉 Production deployment successful!"
else
echo "❌ Health check failed! (HTTP $HTTP_CODE)"
echo ""
echo "💡 Troubleshooting:"
echo " 1. Check if container is running:"
echo " docker ps | grep merchbay_admin_app"
echo ""
echo " 2. Check app logs:"
echo " docker logs merchbay_admin_app"
echo ""
echo " 3. Check Traefik logs:"
echo " docker logs traefik"
echo ""
echo " 4. Test manually:"
echo " curl -Ik https://admin.merchbay.app"
exit 1
fi

View File

@@ -32,6 +32,10 @@ WORKDIR /var/www/html
# Copy existing application directory contents
COPY . /var/www/html
# Copy and set permissions for entrypoint script
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# Create storage directories and set permissions
RUN mkdir -p storage/framework/views \
storage/framework/cache \
@@ -67,5 +71,8 @@ RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
# Expose port 80
EXPOSE 80
# Set entrypoint
ENTRYPOINT ["docker-entrypoint.sh"]
# Start Apache
CMD ["apache2-foreground"]

45
docker-compose.dev.yml Normal file
View File

@@ -0,0 +1,45 @@
services:
app:
image: merchbay_admin:dev
container_name: merchbay_admin_app
restart: unless-stopped
environment:
- APP_ENV=${APP_ENV:-development}
- APP_DEBUG=${APP_DEBUG:-true}
- APP_URL=${APP_URL:-https://dev-admin.merchbay.app}
- DB_CONNECTION=mysql
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT:-3306}
- DB_DATABASE=${DB_DATABASE}
- DB_USERNAME=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
- IMAGES_DIRECTORY=${IMAGES_DIRECTORY}
- PRODUCTION_PRIVATE_SERVER=${PRODUCTION_PRIVATE_SERVER}
volumes:
- ./storage:/var/www/html/storage
- ./public/uploads:/var/www/html/public/uploads
labels:
- "traefik.enable=true"
# Development environment (dev-admin.merchbay.app)
- "traefik.http.routers.merchbay-admin-dev.rule=Host(`dev-admin.merchbay.app`)"
- "traefik.http.routers.merchbay-admin-dev.entrypoints=websecure"
- "traefik.http.routers.merchbay-admin-dev.tls=true"
- "traefik.http.routers.merchbay-admin-dev.tls.certresolver=letsencrypt"
- "traefik.http.services.merchbay-admin-dev.loadbalancer.server.port=80"
# HTTP to HTTPS redirect
- "traefik.http.routers.merchbay-admin-dev-http.rule=Host(`dev-admin.merchbay.app`)"
- "traefik.http.routers.merchbay-admin-dev-http.entrypoints=web"
- "traefik.http.routers.merchbay-admin-dev-http.middlewares=https-redirect"
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
networks:
- traefik-public
- crew-app-net
- default
networks:
traefik-public:
external: true
crew-app-net:
external: true
default:
driver: bridge

45
docker-compose.prod.yml Normal file
View File

@@ -0,0 +1,45 @@
services:
app:
image: merchbay_admin:latest
container_name: merchbay_admin_app
restart: unless-stopped
environment:
- APP_ENV=${APP_ENV:-production}
- APP_DEBUG=${APP_DEBUG:-false}
- APP_URL=${APP_URL:-https://merchbay.app}
- DB_CONNECTION=mysql
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT:-3306}
- DB_DATABASE=${DB_DATABASE}
- DB_USERNAME=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
- IMAGES_DIRECTORY=${IMAGES_DIRECTORY}
- PRODUCTION_PRIVATE_SERVER=${PRODUCTION_PRIVATE_SERVER}
volumes:
- ./storage:/var/www/html/storage
- ./public/uploads:/var/www/html/public/uploads
labels:
- "traefik.enable=true"
# Production environment (merchbay.app)
- "traefik.http.routers.merchbay-admin-prod.rule=Host(`merchbay.app`)"
- "traefik.http.routers.merchbay-admin-prod.entrypoints=websecure"
- "traefik.http.routers.merchbay-admin-prod.tls=true"
- "traefik.http.routers.merchbay-admin-prod.tls.certresolver=le"
- "traefik.http.services.merchbay-admin-prod.loadbalancer.server.port=80"
# HTTP to HTTPS redirect
- "traefik.http.routers.merchbay-admin-prod-http.rule=Host(`merchbay.app`)"
- "traefik.http.routers.merchbay-admin-prod-http.entrypoints=web"
- "traefik.http.routers.merchbay-admin-prod-http.middlewares=https-redirect"
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
networks:
- traefik-public
- crew-app-net
- default
networks:
traefik-public:
external: true
crew-app-net:
external: true
default:
driver: bridge

18
docker-entrypoint.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
set -e
# Create storage directory structure if it doesn't exist
mkdir -p storage/framework/views
mkdir -p storage/framework/cache
mkdir -p storage/framework/sessions
mkdir -p storage/logs
mkdir -p storage/app/public
mkdir -p bootstrap/cache
mkdir -p public/uploads
# Set proper permissions
chown -R www-data:www-data storage bootstrap/cache public/uploads
chmod -R 775 storage bootstrap/cache public/uploads
# Execute the main command
exec "$@"