From 95973084625a088aa945217fcca0fabbccd039d7 Mon Sep 17 00:00:00 2001 From: andrey Date: Mon, 20 Mar 2023 23:19:00 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F=20=E2=84=961?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .docker/nginx/Dockerfile | 9 ++++ .docker/nginx/hosts/application.local.conf | 26 +++++++++ .docker/php/Dockerfile | 33 ++++++++++++ .docker/php/application.local.conf | 19 +++++++ .gitignore | 5 +- Makefile | 11 ++++ README.md | 12 ++++- docker-compose.yml | 58 +++++++++++++++++++++ src/index.html | 11 ++++ src/index.php | 27 ++++++++++ src/static/php.png | Bin 0 -> 7481 bytes 11 files changed, 209 insertions(+), 2 deletions(-) create mode 100644 .docker/nginx/Dockerfile create mode 100644 .docker/nginx/hosts/application.local.conf create mode 100644 .docker/php/Dockerfile create mode 100644 .docker/php/application.local.conf create mode 100644 Makefile create mode 100644 docker-compose.yml create mode 100644 src/index.html create mode 100644 src/index.php create mode 100644 src/static/php.png diff --git a/.docker/nginx/Dockerfile b/.docker/nginx/Dockerfile new file mode 100644 index 000000000..9f4930b7b --- /dev/null +++ b/.docker/nginx/Dockerfile @@ -0,0 +1,9 @@ +FROM nginx:latest + +COPY hosts/application.local.conf /etc/nginx/conf.d/application.local.conf + +WORKDIR /www +VOLUME /www +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/.docker/nginx/hosts/application.local.conf b/.docker/nginx/hosts/application.local.conf new file mode 100644 index 000000000..515313d41 --- /dev/null +++ b/.docker/nginx/hosts/application.local.conf @@ -0,0 +1,26 @@ +server { + listen 80; + server_name application.local; + + root /www/application.local; + + index index.php index.html; + + location ~* .(jpg|jpeg|gif|css|png|js|ico|html)$ { + access_log off; + expires max; + } + + location / { + try_files $uri $uri/ /index.php?$query_string; + } + + location ~* .php$ { + try_files $uri = 404; + fastcgi_split_path_info ^(.+.php)(/.+)$; + fastcgi_pass unix:/var/run/php8-fpm.sock; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } +} \ No newline at end of file diff --git a/.docker/php/Dockerfile b/.docker/php/Dockerfile new file mode 100644 index 000000000..c81873f74 --- /dev/null +++ b/.docker/php/Dockerfile @@ -0,0 +1,33 @@ +FROM php:8.0-fpm + +RUN apt-get update && apt-get install -y \ + libfreetype6-dev \ + libjpeg62-turbo-dev \ + libpng-dev \ + libonig-dev \ + libzip-dev \ + libmemcached-dev \ + libmcrypt-dev \ + libpq-dev \ + && pecl install mcrypt-1.0.4 \ + && docker-php-ext-enable mcrypt \ + && docker-php-ext-install -j$(nproc) iconv mbstring pdo pdo_pgsql pgsql zip \ + && docker-php-ext-configure gd --with-freetype --with-jpeg \ + && docker-php-ext-install -j$(nproc) gd \ + && pecl install memcache \ + && docker-php-ext-enable memcache \ + && pecl install memcached \ + && docker-php-ext-enable memcached \ + && pecl install redis \ + && docker-php-ext-enable redis \ + && rm /usr/local/etc/php-fpm.d/* \ + && curl -sS https://getcomposer.org/installer > composer-setup.php \ + && php composer-setup.php && rm composer-setup.php* \ + && chmod +x composer.phar && mv composer.phar /usr/bin/composer + +COPY application.local.conf /usr/local/etc/php-fpm.d/ + +WORKDIR /www +VOLUME /www + +CMD ["php-fpm"] \ No newline at end of file diff --git a/.docker/php/application.local.conf b/.docker/php/application.local.conf new file mode 100644 index 000000000..401299b13 --- /dev/null +++ b/.docker/php/application.local.conf @@ -0,0 +1,19 @@ +[global] +daemonize = no +error_log = /proc/self/fd/2 +log_limit = 8192 + +[www] +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +catch_workers_output = yes +decorate_workers_output = no +user = www-data +group = www-data +access.log = /proc/self/fd/2 +clear_env = no +listen = /var/run/php8-fpm.sock +listen.mode = 0777 \ No newline at end of file diff --git a/.gitignore b/.gitignore index b9a5796b6..412c5946c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -*.idea \ No newline at end of file +*.idea +logs +run +data \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..8d7430cdb --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +build: + docker-compose -f docker-compose.yml +rebuild: + docker-compose -f docker-compose.yml build --no-cache +start: + docker-compose -f docker-compose.yml up -d +stop: + docker-compose -f docker-compose.yml down +restart: + docker-compose -f docker-compose.yml down + docker-compose -f docker-compose.yml up -d diff --git a/README.md b/README.md index 63b2b9af5..acaa47f1b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ # PHP_2022 -Cheburaev A.D. \ No newline at end of file +HW 1 + +Make команды для работы с docker: +- ```make build``` - сборка контейнеров; +- ```make rebuild``` - пересборка контейнеров; +- ```make start``` - запуск контейнеров; +- ```make stop``` - остановка контейнеров; +- ```make restart``` - перезапуск контейнеров. + +Для того чтобы сайт открывался по адресу ```application.local``` необходимо указать этот адрес в хостах локальной машины. +Например в Ubuntu так ```127.0.0.1 localhost application.local``` diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..b76c81b8c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,58 @@ +version: '3' + +services: + nginx: + build: + context: .docker/nginx + dockerfile: Dockerfile + container_name: nginx + ports: + - "80:80" + volumes: + - ./src:/www/application.local + - ./run:/var/run/ + - ./logs:/var/log/nginx + networks: + - app-network + + app: + build: + context: .docker/php + dockerfile: Dockerfile + container_name: app + volumes: + - ./src:/www/application.local + - ./run:/var/run/ + networks: + - app-network + + memcached: + image: bitnami/memcached:latest + ports: + - "11211:11211" + networks: + - app-network + + redis: + image: redis:alpine + ports: + - "6379:6379" + networks: + - app-network + + postgres: + image: postgres:15.1 + environment: + - POSTGRES_DB=PG_DATABASE + - POSTGRES_USER=PG_USERNAME + - POSTGRES_PASSWORD=PG_PASSWORD + volumes: + - ./data:/var/lib/postgresql/data + ports: + - "5432:5432" + networks: + - app-network + +networks: + app-network: + driver: bridge diff --git a/src/index.html b/src/index.html new file mode 100644 index 000000000..1aec99128 --- /dev/null +++ b/src/index.html @@ -0,0 +1,11 @@ + + + TEST + + +

Hello, OTUS!

+
+ +
+ + \ No newline at end of file diff --git a/src/index.php b/src/index.php new file mode 100644 index 000000000..650bf35af --- /dev/null +++ b/src/index.php @@ -0,0 +1,27 @@ +addServer('memcached'); + echo 'Memcache version ' . $memcache->getVersion() . PHP_EOL; +} catch (\Throwable $throwable) { + echo 'Ошибка подключения Memcache: ' . $throwable->getMessage(); +} + +try { + $redis = new Redis(); + $redis->connect('redis'); + echo '
Redis is connection ' . print_r($redis->isConnected(), true) . PHP_EOL; +} catch (\Throwable $throwable) { + echo 'Ошибка подключения Redis : ' . $throwable->getMessage(); +} + +try { + $dsn = 'pgsql:host=postgres;port=5432;dbname=PG_DATABASE;'; + $psql = new PDO($dsn, 'PG_USERNAME', 'PG_PASSWORD'); + echo '
PSQL is connection'; +} catch (\Throwable $throwable) { + echo 'Ошибка подключения PSQL: ' . $throwable->getMessage(); +} diff --git a/src/static/php.png b/src/static/php.png new file mode 100644 index 0000000000000000000000000000000000000000..34a64e35a50d9c1620ebbe9625fba7c7452ee77b GIT binary patch literal 7481 zcmeHMXH=72mqn^nU%E(BK@bE9y$YX=BBA%5P=fRh(mP5KL|W)b?=29D^j;o7=^X_L zLIi{udKpl^dHuebS!@2xzxk1s=bp3A+57B!@3U4`!c~>!$VqOH;NakpE66`l$HBpa zUw-iME+UUm52G)>s8qq4Pf;k;`T6<9N={BLJUqOiq2V3eUlIq0X<6aPL(Lbn-xd_S zv!7iLgAOY1eX7*?a7sDUGGWfT`Q`jPVdXD!n)q>@0o4P?^rwq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}U2|5NVe#9?G{kek0C7o>k?e$U#LOG2jbYt}%8UYwtH z{M*pCI{)8}KhD7a+78V5-sUtR4h|u7`rHH~`$h^@CZ~Dv67Ot_2i*Z*JcMvTpTVg( zzvLir&Vk3T_U^l%|%#Y@o3hT$vG0>smwls~v#{QHTc@KpIp`6Ecs Fe*pg(A5s7S literal 0 HcmV?d00001 From 6fb390301cd764286abb0f3d74c237c3baa06c2a Mon Sep 17 00:00:00 2001 From: andrey Date: Tue, 21 Mar 2023 21:40:37 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=20=D0=BF=D1=80=D0=BE=D0=B1=D1=80=D0=BE=D1=81=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D0=BE=D0=B2=20?= =?UTF-8?q?=D0=B8=D0=B7=20.env,=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BA=20=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D1=8E=20=E2=84=96?= =?UTF-8?q?1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 3 +++ docker-compose.yml | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 000000000..9a49820fe --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +POSTGRES_DB=postgres +POSTGRES_USER=user +POSTGRES_PASSWORD=password diff --git a/docker-compose.yml b/docker-compose.yml index b76c81b8c..966ade770 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,9 +43,9 @@ services: postgres: image: postgres:15.1 environment: - - POSTGRES_DB=PG_DATABASE - - POSTGRES_USER=PG_USERNAME - - POSTGRES_PASSWORD=PG_PASSWORD + - POSTGRES_DB=${POSTGRES_DB} + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} volumes: - ./data:/var/lib/postgresql/data ports: