Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
85 changes: 85 additions & 0 deletions .docker/invoiceplane-banner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/bash
# InvoicePlane Docker Container Banner
# Shared banner script for all InvoicePlane Docker containers
# Follows DRY, SOLID, and early return principles

# Early return if not in interactive shell
[[ $- != *i* ]] && return

# Color definitions - InvoicePlane brand colors
readonly IPBLUE='\033[38;2;66;154;225m' # #429AE1 - InvoicePlane brand blue
readonly GREEN='\033[0;32m'
readonly YELLOW='\033[1;33m'
readonly NC='\033[0m' # No Color

# Helper function to display the InvoicePlane ASCII logo
show_logo() {
cat << 'EOF'
____ _ ____ __
/ _/___ _ ______ (_)_______ / __ \/ /___ _____ ___
/ // __ \ | / / __ \/ / ___/ _ / /_/ / / __ `/ __ \/ _ \
_/ // / / / |/ / /_/ / / /__/ __/ ____/ / /_/ / / / / __/
/___/_/ /_/|___/\____/_/\___/\___/_/ /_/\__,_/_/ /_/\___/

EOF
}

# Helper function to show PHP version if available
show_php_version() {
if command -v php >/dev/null 2>&1; then
local php_version
php_version=$(php -v 2>/dev/null | head -n1 | cut -d' ' -f2 || echo "unknown")
echo -e "${IPBLUE}║${NC} PHP Version: ${GREEN}${php_version}${NC}"
fi
}

# Helper function to show quick commands
show_quick_commands() {
echo ""
echo -e "${IPBLUE}Quick Commands:${NC}"

# Show PHP-related commands if PHP is available
if command -v php >/dev/null 2>&1; then
echo -e " ${GREEN}php -v${NC} - Check PHP version"
fi

# Show Composer if available
if command -v composer >/dev/null 2>&1; then
echo -e " ${GREEN}composer${NC} - Run Composer"
fi

# Show common directories
if [[ -d /var/www/projects ]]; then
echo -e " ${GREEN}cd /var/www/projects${NC} - Go to projects directory"
fi

echo ""
}

# Main banner display function
display_banner() {
local container_type="${CONTAINER_TYPE:-InvoicePlane Docker Environment}"

# Display logo
show_logo

# Display info box with PHP version if available
echo -e "${IPBLUE}╔════════════════════════════════════════════════════════════╗${NC}"
echo -e "${IPBLUE}║${NC} Welcome to ${container_type} ${IPBLUE}║${NC}"
show_php_version
echo -e "${IPBLUE}╚════════════════════════════════════════════════════════════╝${NC}"

# Show additional info
local user_name host_name current_dir
user_name=$(whoami 2>/dev/null || echo "unknown")
host_name=$(hostname 2>/dev/null || echo "unknown")
current_dir=$(pwd 2>/dev/null || echo "~")

echo -e "Container: ${GREEN}${host_name}${NC} | User: ${YELLOW}${user_name}${NC} | Dir: ${GREEN}${current_dir}${NC}"

# Display quick commands
show_quick_commands
}

# Execute main function
display_banner
30 changes: 30 additions & 0 deletions .docker/laravel-echo-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM node:alpine

# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

# Install app dependencies
COPY package.json /usr/src/app/

# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.

ARG CHANGE_SOURCE=false
RUN if [ ${CHANGE_SOURCE} = true ]; then \
# Change application source from dl-cdn.alpinelinux.org to aliyun source
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories \
;fi

RUN apk add --update \
python3 \
python3-dev \
py3-pip \
build-base

RUN npm install

# Bundle app source
COPY laravel-echo-server.json /usr/src/app/laravel-echo-server.json

EXPOSE 3000
CMD [ "npm", "start", "--force" ]
19 changes: 19 additions & 0 deletions .docker/laravel-echo-server/laravel-echo-server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"authHost": "localhost",
"authEndpoint": "/broadcasting/auth",
"clients": [],
"database": "redis",
"databaseConfig": {
"redis": {
"port": "6379",
"host": "redis"
}
},
"devMode": true,
"host": null,
"port": "6001",
"protocol": "http",
"socketio": {},
"sslCertPath": "",
"sslKeyPath": ""
}
12 changes: 12 additions & 0 deletions .docker/laravel-echo-server/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "laravel-echo-server-docker",
"description": "Docker container for running laravel-echo-server",
"version": "0.0.1",
"license": "MIT",
"dependencies": {
"laravel-echo-server": "^1.5.0"
},
"scripts": {
"start": "laravel-echo-server start"
}
}
Loading