-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.websocket
More file actions
64 lines (49 loc) · 1.75 KB
/
Dockerfile.websocket
File metadata and controls
64 lines (49 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM php:8.4-cli
ARG http_proxy
ARG https_proxy
ENV http_proxy=${http_proxy}
ENV https_proxy=${https_proxy}
# Configure PEAR
RUN if [ -n "${http_proxy}" ]; then pear config-set http_proxy ${http_proxy}; fi && \
pear config-set php_ini $PHP_INI_DIR/php.ini
RUN apt-get update && \
apt-get install -y \
git \
unzip \
libzip-dev \
supervisor \
cron \
# Install PostgreSQL dependencies
libpq-dev \
# Install dependencies for other PHP extensions
libxml2-dev \
libxslt1-dev \
libgd-dev \
libicu-dev \
# Install any other database drivers you might need
&& pecl install redis \
&& docker-php-ext-enable redis \
# Install PostgreSQL driver
&& docker-php-ext-install pdo_pgsql \
# Install missing extensions
&& docker-php-ext-install soap xsl gd opcache intl ftp \
# Other extensions
&& docker-php-ext-install zip sockets
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
WORKDIR /var/www/html
# Create directory for websocket logs
RUN mkdir -p /var/log/websocket && \
chmod -R 777 /var/log/websocket
# Create supervisor directories
RUN mkdir -p /var/log/supervisor /etc/supervisor/conf.d
# Copy supervisor configuration
COPY supervisord-websocket.conf /etc/supervisor/supervisord.conf
# Set an entrypoint to handle any initialization before running WebSocket server
COPY docker-entrypoint-websocket.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint-websocket.sh
# Setup healthcheck
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD php /var/www/html/src/WebSocket/health_check.sh || exit 1
ENTRYPOINT ["docker-entrypoint-websocket.sh"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]