Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Commit 0d1c9f7

Browse files
committed
fix: container server
1 parent 3e1c7cf commit 0d1c9f7

3 files changed

Lines changed: 280 additions & 24 deletions

File tree

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
"php": "^8.2",
1010
"kitdelivery/sdk-kit-api": "dev-main",
1111
"laravel/framework": "^11.31",
12-
"symfony/finder": "^7.0.7",
13-
"laravel/tinker": "^2.9"
12+
"laravel/octane": "*",
13+
"laravel/tinker": "^2.9",
14+
"symfony/finder": "^7.0.7"
1415
},
1516
"repositories": [
1617
{

composer.lock

Lines changed: 262 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/app.dockerfile

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,36 @@ RUN apt-get update && apt-get install -y \
1010
zip \
1111
unzip \
1212
libssl-dev \
13-
pkg-config \
14-
zlib1g-dev \
15-
libbrotli-dev
13+
&& rm -rf /var/lib/apt/lists/*
1614

1715
# Install PHP extensions
18-
RUN docker-php-ext-install pdo mbstring exif pcntl bcmath gd
16+
RUN docker-php-ext-install mbstring exif pcntl bcmath gd
1917

2018
# Install Redis extension
21-
RUN pecl install redis \
22-
&& docker-php-ext-enable redis
19+
RUN pecl install redis && docker-php-ext-enable redis
2320

24-
# Install Swoole extension for Octane
25-
RUN pecl install swoole --enable-brotli=no --enable-openssl=no \
26-
&& docker-php-ext-enable swoole
21+
# Install Swoole extension
22+
RUN pecl install swoole-5.0.3 && docker-php-ext-enable swoole
2723

2824
# Install Composer
29-
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
25+
COPY --from=composer:2.8.6 /usr/bin/composer /usr/bin/composer
3026

3127
WORKDIR /var/www/html
3228

33-
# Copy entire application first
29+
# Copy the entire application
3430
COPY . .
3531

36-
# Set environment variable for unattended installation
37-
ENV COMPOSER_COMPILE=all
32+
## Install dependencies including Laravel Octane
33+
#RUN composer require laravel/octane
34+
RUN composer install
3835

39-
# Install dependencies
40-
RUN php -d memory_limit=-1 /usr/bin/composer install --no-interaction
41-
42-
# Install Octane
43-
RUN php -d memory_limit=-1 /usr/bin/composer require laravel/octane --with-all-dependencies
36+
# Run Octane installation with Swoole
37+
RUN php artisan octane:install --server=swoole
4438

4539
# Set proper permissions
46-
RUN chown -R www-data:www-data /var/www/html
40+
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
4741

48-
# Create .env file if it doesn't exist
42+
# Create .env file from example if it doesn't exist
4943
RUN if [ ! -f .env ]; then cp .env.example .env; fi
5044

5145
# Generate application key only if not already set
@@ -55,4 +49,4 @@ RUN php artisan key:generate --force
5549
EXPOSE 8000
5650

5751
# Run Octane server
58-
CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8000"]
52+
CMD ["sh", "-c", "php artisan octane:start --server=swoole --host=0.0.0.0 --port=${PORT:-8000}"]

0 commit comments

Comments
 (0)