Skip to content

Commit

Permalink
hw6
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximTsikhonov committed Sep 17, 2023
1 parent 049f6da commit 98a8181
Show file tree
Hide file tree
Showing 23 changed files with 1,646 additions and 75 deletions.
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# PHP_2023

https://otus.ru/lessons/razrabotchik-php/?utm_source=github&utm_medium=free&utm_campaign=otus

### Init Docker App
- cd ./docker
- copy .env.example .env
- Set the environment for .env
- Build Image: docker-compose up --build -d


### Init Homestead
- cd ./homestead
- Read: **[Homestead](https://laravel.com/docs/10.x/homestead)**
### Init Docker
```bash
cd app
docker-compose up --build -d
docker exec -it php-server bash
composer install
exit;
```

- Add **mysite.local** in /etc/hosts

### Test
```bash
curl -d "[email protected],[email protected]" -X POST http://mysite.local
```
3 changes: 3 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.env
nginx/logs/*
vendor
21 changes: 21 additions & 0 deletions app/Docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3.3'

services:
nginx:
image: nginx:latest
ports:
- "80:80"
volumes:
- ./nginx/conf:/etc/nginx/conf.d
- ./nginx/logs:/var/log/nginx
- ./www:/var/www
links:
- php

php:
build: ./php
container_name: php-server
hostname: php-server
volumes:
- ./www:/var/www

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
server {
index index.php;
server_name application.local;
server_name mysite.local;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www;
root /var/www/public;

location ~ \.php$ {
try_files $uri =404;
Expand Down
7 changes: 6 additions & 1 deletion docker/php/Dockerfile → app/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ RUN apt-get update && apt-get install -y \
&& pecl install memcached-3.2.0 \
&& docker-php-ext-enable memcached \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd
&& docker-php-ext-install -j$(nproc) gd

RUN apt-get update && apt-get install -y \
zip libzip-dev \
&& docker-php-ext-configure zip \
&& docker-php-ext-install zip


# Composer
Expand Down
File renamed without changes.
Empty file added app/www/bootstrap.php
Empty file.
24 changes: 24 additions & 0 deletions app/www/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "root/www",
"type": "project",
"autoload": {
"psr-4": {
"Root\\Www\\": "src/"
}
},
"authors": [
{
"name": "MT"
}
],
"require": {
"slim/slim": "4.*",
"slim/psr7": "^1.6",
"nyholm/psr7": "^1.8",
"nyholm/psr7-server": "^1.0",
"guzzlehttp/psr7": "^2",
"laminas/laminas-diactoros": "^3.2",
"php-di/php-di": "^7.0",
"selective/basepath": "^2.2"
}
}
Loading

0 comments on commit 98a8181

Please sign in to comment.