Skip to content

Commit 5935ac8

Browse files
authored
Merge pull request #2 from utopia-php/dev
Multi protocol proxy
2 parents 2b9a550 + 63a0194 commit 5935ac8

83 files changed

Lines changed: 9481 additions & 2182 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.git
2+
.gitignore
3+
.idea
4+
vendor
5+
*.md
6+
.dockerignore
7+
Dockerfile
8+
docker-compose.yml

.env.example

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Database Configuration
2+
DB_HOST=mariadb
3+
DB_PORT=3306
4+
DB_USER=appwrite
5+
DB_PASS=password
6+
DB_NAME=appwrite
7+
8+
# Redis Configuration
9+
REDIS_HOST=redis
10+
REDIS_PORT=6379
11+
12+
# Compute API Configuration
13+
COMPUTE_API_URL=http://appwrite-api/v1/compute
14+
COMPUTE_API_KEY=
15+
16+
# MySQL Root Password (for docker-compose)
17+
MYSQL_ROOT_PASSWORD=rootpassword
18+
19+
# TLS Configuration (for TCP proxy)
20+
PROXY_TLS_ENABLED=false
21+
PROXY_TLS_CERT=
22+
PROXY_TLS_KEY=
23+
PROXY_TLS_CA=
24+
PROXY_TLS_REQUIRE_CLIENT_CERT=false

.github/workflows/integration.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Integration Tests
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
integration:
8+
name: Integration Tests
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup PHP
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: '8.4'
19+
extensions: swoole, redis, sockets
20+
tools: composer:v2
21+
22+
- name: Install dependencies
23+
run: composer install --prefer-dist --no-progress
24+
25+
- name: Run integration tests
26+
run: composer test:integration

.github/workflows/lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
pint:
8+
name: Laravel Pint
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup PHP
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: '8.4'
19+
extensions: swoole, redis
20+
tools: composer:v2
21+
22+
- name: Install dependencies
23+
run: composer install --no-interaction --prefer-dist
24+
25+
- name: Run Pint
26+
run: composer lint
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Static Analysis
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
phpstan:
8+
name: PHPStan
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup PHP
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: '8.4'
19+
extensions: swoole, redis
20+
tools: composer:v2
21+
22+
- name: Install dependencies
23+
run: composer install --no-interaction --prefer-dist
24+
25+
- name: Run PHPStan
26+
run: composer check

.github/workflows/tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Tests
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
unit:
8+
name: Unit Tests
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup PHP
16+
uses: shivammathur/setup-php@v2
17+
with:
18+
php-version: '8.4'
19+
extensions: swoole, redis, sockets
20+
tools: composer:v2
21+
22+
- name: Install dependencies
23+
run: composer install --prefer-dist --no-progress
24+
25+
- name: Run tests
26+
run: composer test

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
/vendor/
22
/composer.lock
33
/.phpunit.cache
4+
/.phpunit.result.cache
45
/.php-cs-fixer.cache
56
/phpstan.neon
67
/.idea/
78
.DS_Store
89
*.log
910
/coverage/
11+
12+
# Environment files
13+
.env
14+
15+
# Docker volumes
16+
/docker-volumes/

Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM php:8.4.18-cli-alpine3.23
2+
3+
RUN apk update && apk upgrade && apk add --no-cache \
4+
autoconf \
5+
g++ \
6+
make \
7+
linux-headers \
8+
libstdc++ \
9+
brotli-dev \
10+
libzip-dev \
11+
openssl-dev \
12+
&& rm -rf /var/cache/apk/*
13+
14+
RUN docker-php-ext-install \
15+
pcntl \
16+
sockets \
17+
zip
18+
19+
RUN pecl channel-update pecl.php.net
20+
21+
RUN pecl install swoole && \
22+
docker-php-ext-enable swoole
23+
24+
RUN pecl install redis && \
25+
docker-php-ext-enable redis
26+
27+
WORKDIR /app
28+
29+
COPY composer.json ./
30+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
31+
RUN composer install \
32+
--no-dev \
33+
--optimize-autoloader
34+
35+
COPY . .
36+
37+
RUN addgroup -S app && adduser -S -G app app
38+
USER app
39+
40+
EXPOSE 8080 8081 8025
41+
42+
CMD ["php", "examples/http.php"]

Dockerfile.test

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
FROM php:8.4-cli-alpine AS test
2+
3+
RUN apk add --no-cache \
4+
autoconf \
5+
g++ \
6+
make \
7+
linux-headers \
8+
libstdc++ \
9+
brotli-dev \
10+
libzip-dev \
11+
openssl-dev
12+
13+
RUN docker-php-ext-install \
14+
pcntl \
15+
sockets \
16+
zip
17+
18+
RUN pecl channel-update pecl.php.net && \
19+
pecl install swoole && \
20+
docker-php-ext-enable swoole
21+
22+
RUN pecl install redis && \
23+
docker-php-ext-enable redis
24+
25+
WORKDIR /app
26+
27+
COPY composer.json ./
28+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
29+
RUN composer install \
30+
--optimize-autoloader
31+
32+
COPY . .

0 commit comments

Comments
 (0)