Dockerfile
760 Bytes
FROM php:8.2-cli
# Install dependencies and extensions
RUN apt-get update && apt-get install -y \
git \
unzip \
libzip-dev \
&& docker-php-ext-install pcntl posix sockets zip pdo_mysql
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /app
# Copy dependency definition first
COPY composer.json ./
# Install dependencies (if composer.lock exists it would be better, but we start fresh)
RUN composer install --no-scripts --no-autoloader
# Copy application source
COPY . .
# Generate autoloader
RUN composer dump-autoload --optimize
# Expose WebSocket port
EXPOSE 8888
# Command to run the Workerman server
CMD ["php", "start.php", "start"]