Skeleton is ready

This commit is contained in:
2026-01-05 16:33:20 +04:00
commit eeaf43ab5d
89 changed files with 2704 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
name: project
services:
php:
build:
context: ../../
dockerfile: deploy/main/php.Dockerfile
container_name: project-php
depends_on:
- pgsql
volumes:
- project-cache-volume:/var/www/html/bootstrap/cache
- project-vendor-volume:/var/www/html/vendor
- project-storage-volume:/var/www/html/storage
- project-log-volume:/var/www/html/storage/logs
networks:
project-network:
aliases:
- project-php
restart: unless-stopped
supervisor:
build:
context: ../../
dockerfile: deploy/main/supervisor.Dockerfile
container_name: project-supervisor
depends_on:
- pgsql
- php
environment:
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
volumes:
- project-cache-volume:/var/www/html/bootstrap/cache
- project-vendor-volume:/var/www/html/vendor
- project-storage-volume:/var/www/html/storage
- project-log-volume:/var/www/html/storage/logs
networks:
- project-network
restart: unless-stopped
pgsql:
image: postgres:17
container_name: project-pgsql
environment:
- POSTGRES_DB=${DB_DATABASE}
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
volumes:
- project-pgsql-volume:/var/lib/postgresql/data
networks:
- project-network
ports:
- "127.0.0.1:5432:5432"
restart: unless-stopped
volumes:
project-cache-volume:
project-vendor-volume:
project-storage-volume:
project-log-volume:
project-pgsql-volume:
networks:
project-network:
external: true

View File

@@ -0,0 +1,11 @@
[program:default-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:work --queue=default --sleep=3 --tries=3
autostart=true
autorestart=true
user=www-data
numprocs=4
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stopwaitsecs=3600

View File

@@ -0,0 +1,27 @@
FROM php:8.3-fpm
ENV MAKEFLAGS="-j$(nproc)"
RUN apt-get update
RUN apt-get install -y git zip unzip curl \
libicu-dev libzip-dev libcurl4-openssl-dev libxml2-dev libpq-dev libonig-dev
RUN docker-php-ext-install intl zip bcmath xml pdo pdo_pgsql dom mbstring curl
# Install xdebug and redis extensions if needed
#
# RUN pecl install xdebug redis-6.2.0
# RUN docker-php-ext-enable redis
COPY --from=composer /usr/bin/composer /usr/bin/composer
# xDebug configuration
#
# COPY ./usr/local/etc/php/conf.d/* /usr/local/etc/php/conf.d/
WORKDIR /var/www/html
COPY composer.* .
RUN composer install --no-dev
COPY . .

View File

@@ -0,0 +1,39 @@
FROM php:8.3-cli
RUN apt-get update
RUN apt-get install -y git zip unzip curl netcat-openbsd supervisor\
libicu-dev libzip-dev libcurl4-openssl-dev libxml2-dev libpq-dev libonig-dev
RUN docker-php-ext-install intl zip bcmath xml pdo pdo_pgsql dom mbstring curl
# Install xdebug and redis extensions if needed
#
#RUN pecl install xdebug redis-6.2.0
#RUN docker-php-ext-enable redis
COPY --from=composer /usr/bin/composer /usr/bin/composer
# xDebug configuration
#
# COPY ./usr/local/etc/php/conf.d/* /usr/local/etc/php/conf.d/
COPY deploy/main/usr/local/bin/supervisor.entrypoint.sh /usr/local/bin/supervisor.entrypoint.sh
# Set permissions to match host user (optional)
#
# RUN usermod -u 1000 www-data
# RUN groupmod -g 1000 www-data
RUN chmod +x /usr/local/bin/supervisor.entrypoint.sh
RUN chown -R www-data:www-data /var/www/html
WORKDIR /var/www/html
COPY composer.* .
RUN composer install --no-dev
COPY . .
ENTRYPOINT ["/usr/local/bin/supervisor.entrypoint.sh"]
CMD ["-c", "/etc/supervisor/supervisord.conf", "-n"]

View File

@@ -0,0 +1,21 @@
#!/bin/sh
echo "Waiting for redis startup..."
while ! nc -z "${REDIS_HOST}" "${REDIS_PORT}"; do
sleep 1
done
echo "Redis has started!"
echo "Waiting for database startup..."
while ! nc -z "${DB_HOST}" "${DB_PORT}"; do
sleep 1
done
echo "Database has started!"
echo "Running supervisor daemon..."
exec /usr/bin/supervisord $@

View File

@@ -0,0 +1,4 @@
xdebug.mode=debug
xdebug.start_with_request=trigger
xdebug.client_host=host.docker.internal
xdebug.client_port=9003