app_php | 172.18.0.5 - 26/Apr/2020:07:02:22 +0000 "GET /frontend/web/index.php" 200
nginx_1 | 172.18.0.1 - - [26/Apr/2020:07:02:22 +0000] "GET / HTTP/1.1" 200 4338 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36" "-"
app_php | 172.18.0.5 - 26/Apr/2020:07:02:22 +0000 "GET /frontend/web/index.php" 200
nginx_1 | 172.18.0.1 - - [26/Apr/2020:07:02:24 +0000] "GET /frontend/web/assets/50659147/css/bootstrap.css HTTP/1.1" 200 4338 "http://app-test.local/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36" "-"
app_php | 172.18.0.5 - 26/Apr/2020:07:02:23 +0000 "GET /frontend/web/index.php" 200
nginx_1 | 172.18.0.1 - - [26/Apr/2020:07:02:25 +0000] "GET /frontend/web/assets/3e6b251a/jquery.js HTTP/1.1" 200 4338 "http://app-test.local/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36" "-"
app_php | 172.18.0.5 - 26/Apr/2020:07:02:22 +0000 "GET /frontend/web/index.php" 200
nginx_1 | 172.18.0.1 - - [26/Apr/2020:07:02:25 +0000] "GET /frontend/web/assets/9dc4989/yii.js HTTP/1.1" 200 4338 "http://app-test.local/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36" "-"
app_php | 172.18.0.5 - 26/Apr/2020:07:02:22 +0000 "GET /frontend/web/index.php" 200
nginx_1 | 172.18.0.1 - - [26/Apr/2020:07:02:25 +0000] "GET /frontend/web/css/site.css HTTP/1.1" 200 4338 "http://app-test.local/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36" "-"
app_php | 172.18.0.5 - 26/Apr/2020:07:02:24 +0000 "GET /frontend/web/index.php" 200
nginx_1 | 172.18.0.1 - - [26/Apr/2020:07:02:26 +0000] "GET /frontend/web/assets/50659147/js/bootstrap.js HTTP/1.1" 200 4332 "http://app-test.local/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36" "-"
nginx_1 | 2020/04/25 17:17:35 [error] 7#7: *6 open() "/usr/share/nginx/html/favicon.ico" failed (2: No such file or directory), client: 172.18.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost", referrer: "http://localhost/"
nginx_1 | 172.18.0.1 - - [25/Apr/2020:17:17:35 +0000] "GET /favicon.ico HTTP/1.1" 404 556 "http://localhost/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36" "-"
nginx_1 | 172.18.0.1 - - [25/Apr/2020:17:18:46 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36" "-"
nginx_1 | 172.18.0.1 - - [25/Apr/2020:17:18:50 +0000] "GET / HTTP/1.1" 200 612 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.122 Safari/537.36" "-"
version: '3'
services:
app_php:
container_name: app_php
build:
context: .
dockerfile: ./docker/Dockerfile
environment:
XDEBUG_CONFIG: remote_host=host.docker.internal
PHP_IDE_CONFIG: serverName=localhost
volumes:
- ./:/var/www
links:
- db
depends_on:
- db
nginx:
image: nginx
volumes:
- ./docker/conf/nginx:/etc/nginx/sites-enable/
- ./:/var/www
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- 80:80
depends_on:
- app_php
adminer:
image: adminer
restart: always
ports:
- 8080:8080
db:
container_name: mysql_kfnp_yii2
image: percona:latest
command: --default-authentication-plugin=mysql_native_password
restart: on-failure
ports:
- 3306:3306
expose:
- 3306
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: yii2basic
MYSQL_USER: mysqluser
MYSQL_PASSWORD: mysqluser
FROM php:7.3-fpm
RUN apt-get update && apt-get install -y \
git \
curl \
wget \
libzip-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev zlib1g-dev libicu-dev g++ libmagickwand-dev --no-install-recommends libxml2-dev \
&& docker-php-ext-configure intl \
&& docker-php-ext-install intl \
&& docker-php-ext-install mbstring zip xml gd pdo_mysql \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& pecl install xdebug-2.7.1 \
&& docker-php-ext-enable xdebug
RUN wget https://getcomposer.org/installer -O - -q \
| php -- --install-dir=/bin --filename=composer --quiet
WORKDIR /var/www
CMD ["php-fpm"]
server {
listen 80 default_server;
server_name app-test.local;
set $base_root /var/www;
root $base_root;
charset UTF-8;
index index.php index.html;
location / {
root $base_root/frontend/web;
try_files $uri $uri/ /frontend/web/index.php$is_args$args;
location ~ ^/assets/.+\.php(/|$) {
deny all;
}
}
location /admin {
alias $base_root/backend/web/;
try_files $uri /backend/web/index.php$is_args$args;
location ~ ^/admin/assets/.+\.php(/|$) {
deny all;
}
}
location ~ ^/.+\.php(/|$) {
rewrite (?!^/((frontend|backend)/web|admin))^ /frontend/web$uri break;
rewrite (?!^/backend/web)^/admin(/.+)$ /backend/web$1 break;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# контейнер php-fpm
fastcgi_pass app_php:9000;
fastcgi_index index.php;
fastcgi_read_timeout 1000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~ /\. {
deny all;
}
}
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e6d8beb9766c nginx "nginx -g 'daemon of…" 18 minutes ago Up 4 minutes 0.0.0.0:80->80/tcp app-test_nginx_1
1eec4bf1a0eb app-test_app_php "docker-php-entrypoi…" 19 minutes ago Up 4 minutes 9000/tcp app_php
d7a53d05dc06 adminer "entrypoint.sh docke…" 19 minutes ago Up 4 minutes 0.0.0.0:8080->8080/tcp app-test_adminer_1
cdad2b11607e percona:latest "/docker-entrypoint.…" 19 minutes ago Up 4 minutes 0.0.0.0:3306->3306/tcp mysql_kfnp_yii2
419d3503a2d8 b54de258fc7c "/bin/sh -c 'apt-get…" 2 hours ago Exited (1) About an hour ago reverent_agnesi
be04cda8113e b54de258fc7c "/bin/sh -c 'apt-get…" 2 hours ago Exited (1) 2 hours ago admiring_engelbart
82ff79cbbd8b b54de258fc7c "/bin/sh -c 'apt-get…" 2 hours ago Exited (1) 2 hours ago determined_swanson
e1c9704b72f5 b54de258fc7c "/bin/sh -c 'apt-get…" 2 hours ago Exited (1) 2 hours ago jolly_jones
ERROR: for nginx_kfnp_yii2 Cannot start service webserver: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"php-fpm\": executable file not found in $PATH": unknown
ERROR: for webserver Cannot start service webserver: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"php-fpm\": executable file not found in $PATH": unknown
ERROR: Encountered errors while bringing up the project
MacBook-Pro-user:~ user$ cat ~/.bash_profile
export PATH="/usr/local/opt/mysql@5.7/bin:$PATH"
export PARH="/usr/local/local/opt/php@7.3/bin:$PATH"
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools