Added support for Domain and Subdomain URLs

This commit is contained in:
DylanBanta 2024-11-24 23:45:38 -05:00
parent d42bc1fb4b
commit 5406aa55bb
5 changed files with 24 additions and 5 deletions

7
.gitignore vendored
View File

@ -1 +1,8 @@
logs/* logs/*
# Ignore everything in the /config directory
config/*
# Except for example.env and testing.env
!config/example.com.env
!config/testing.example.com.env

View File

@ -18,10 +18,13 @@
--- ---
### **Test Example** ### **Test Example**
For this example we'll set up a laravel site at the subdomain testing.example.com
**Input**: `config/testing.env`: **Input**: `config/testing.env`:
```env ```env
# General Configurations # General Configurations
PROJECT_NAME=testing.example.com PROJECT_NAME=testing
BASE_URL=example.com
APP_SERVICE_NAME=app-{PROJECT_NAME} APP_SERVICE_NAME=app-{PROJECT_NAME}
# Network # Network
@ -44,6 +47,13 @@ PHP_VERSION=8.3-fpm
PHP_EXTENSIONS=pdo_mysql mbstring exif pcntl bcmath gd PHP_EXTENSIONS=pdo_mysql mbstring exif pcntl bcmath gd
``` ```
If you want to use a url without a subdomain use the following instead, it will use testing.com
```env
# General Configurations
PROJECT_NAME=testing
BASE_URL=com
```
**Command**: **Command**:
```bash ```bash
./setup.sh config/testing.env ./setup.sh config/testing.env

View File

@ -1,5 +1,6 @@
# General Configurations # General Configurations
PROJECT_NAME=example.com PROJECT_NAME=example
BASE_URL=com
APP_SERVICE_NAME=app-{PROJECT_NAME} APP_SERVICE_NAME=app-{PROJECT_NAME}
# Network # Network

View File

@ -1,5 +1,6 @@
# General Configurations # General Configurations
PROJECT_NAME=testing.example.com PROJECT_NAME=testing
BASE_URL=example.com
APP_SERVICE_NAME=app-{PROJECT_NAME} APP_SERVICE_NAME=app-{PROJECT_NAME}
# Network # Network

View File

@ -33,7 +33,7 @@ while IFS='=' read -r key value; do
done < "$ENV_FILE" done < "$ENV_FILE"
# Create the project directory # Create the project directory
PROJECT_DIR="../${PROJECT_NAME}" PROJECT_DIR="../${PROJECT_NAME}.${BASE_URL}"
echo "Creating project directory: $PROJECT_DIR" echo "Creating project directory: $PROJECT_DIR"
mkdir -p "$PROJECT_DIR" mkdir -p "$PROJECT_DIR"