server {
server_name crm.loc;
root /var/www/app/public;
location / {
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param APP_X_SHOP $http_x_shop;
fastcgi_param APP_X_SESSION $http_x_session;
# Prevents URIs that include the front controller. This will 404:
# http://domain.tld/index.php/some-path
# Remove the internal directive to allow URIs like this
internal;
}
# return 404 for all other php files not matching the front controller
# this prevents access to other php files you don't want to be accessible.
location ~ \.php$ {
return 404;
}
error_log /docker.stderr;
access_log /docker.stdout;
}
version: '3'
services:
app:
container_name: 2kurs_php_nginx
volumes:
- ../:/var/www/app
build:
context: ../
dockerfile: docker/Dockerfile
ports:
- '80:80'
depends_on:
- mysql
- redis
networks:
- '2kurs'
redis:
container_name: 2kurs_redis
image: redis:5.0.6
restart: always
volumes:
- 2kurs_redis:/data
ports:
- '6379:6379'
logging:
driver: none
networks:
- '2kurs'
mysql:
container_name: 2kurs_mysql
image: mariadb:10.3.23
command: --default-authentication-plugin=mysql_native_password
restart: always
volumes:
- 2kurs_mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: 2kurs
MYSQL_USER: 2kurs
MYSQL_PASSWORD: 2kurs
ports:
- '3306:3306'
logging:
driver: none
networks:
- '2kurs'
networks:
2kurs:
driver: bridge
volumes:
2kurs_mysql: {}
2kurs_redis: {}
version: '3'
services:
app:
container_name: 2kurs_php_nginx
volumes:
- ../:/var/www/app
build:
context: ../
dockerfile: docker/Dockerfile
ports:
- '80:80'
depends_on:
- mysql
- redis
networks:
#- '2kurs'
2kurs:
aliases:
- crm.loc
redis:
container_name: 2kurs_redis
image: redis:5.0.6
restart: always
volumes:
- 2kurs_redis:/data
ports:
- '6379:6379'
logging:
driver: none
networks:
#- '2kurs'
2kurs:
aliases:
- crm.loc
mysql:
container_name: 2kurs_mysql
image: mariadb:10.3.23
command: --default-authentication-plugin=mysql_native_password
restart: always
volumes:
- 2kurs_mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: 2kurs
MYSQL_USER: 2kurs
MYSQL_PASSWORD: 2kurs
ports:
- '3306:3306'
logging:
driver: none
networks:
#- '2kurs'
2kurs:
aliases:
- crm.loc
networks:
2kurs:
driver: bridge
volumes:
2kurs_mysql: {}
2kurs_redis: {}