-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hw2 #82
Open
ilyasadkin
wants to merge
3
commits into
SadkinID/main
Choose a base branch
from
SadkinID/hw2
base: SadkinID/main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
hw2 #82
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
Check failure on line 1 in Docker/code/index.php
|
||
echo "Hello, Проверяющие :)"; | ||
|
||
phpinfo(); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM php:8.3-fpm | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
wget \ | ||
git \ | ||
libfreetype6-dev \ | ||
libjpeg62-turbo-dev \ | ||
libpng-dev \ | ||
libonig-dev \ | ||
libzip-dev \ | ||
&& docker-php-ext-install -j$(nproc) iconv mbstring mysqli pdo_mysql zip \ | ||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \ | ||
&& docker-php-ext-install -j$(nproc) gd \ | ||
&& mkdir -p /run/php | ||
|
||
# Устанавливаем Composer | ||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer | ||
COPY php.ini /usr/local/etc/php/conf.d/php-custom.ini | ||
COPY zz-docker.conf /usr/local/etc/php-fpm.d/zz-docker.conf | ||
|
||
|
||
WORKDIR /data | ||
|
||
VOLUME /data | ||
|
||
CMD ["php-fpm"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
session.save_handler = memcache | ||
session.save_path = "tcp://memcache:11211" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[global] | ||
daemonize = no | ||
|
||
[www] | ||
listen = /run/php/php-fpm.sock | ||
listen.mode = 0666 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM nginx:latest | ||
COPY hosts/application.local.conf /etc/nginx/conf.d/application.local.conf | ||
|
||
WORKDIR /data | ||
VOLUME /data | ||
EXPOSE 80 | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
server { | ||
listen 80; | ||
server_name application.local; | ||
|
||
root /data/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/php/php-fpm.sock; | ||
fastcgi_index index.php; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -ne 2 ]; then | ||
echo "Дай мне два числа, разделенные пробелом :)" | ||
exit | ||
fi | ||
|
||
num1=$(echo "$1" | sed 's/,/./') | ||
|
||
num2=$(echo "$2" | sed 's/,/./') | ||
|
||
if ! [[ $num1 =~ ^[-+]?[0-9]+(\.[0-9]+)?$ ]] || ! [[ $num2 =~ ^[-+]?[0-9]+(\.[0-9]+)?$ ]]; then | ||
echo "Мне не удалось разобрать один из передаваемых аргументов :(" | ||
exit | ||
fi | ||
|
||
sum=$(awk "BEGIN {print $num1 + $num2}") | ||
|
||
echo "Ответ: $sum" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -f "$1" ]; then | ||
echo "Мне не удалось найти передаваемый файл." | ||
exit | ||
fi | ||
|
||
if [ -z $2 ]; then | ||
count=3 | ||
else | ||
count=$2 | ||
fi | ||
|
||
cat $1 | tail -n +2 | awk '{print $3}' | grep -v '^$'| sort | uniq | while read city; do | ||
summ=$(cat $1 | tail -n +2 | grep $city | awk '{sum += $4;} END {print sum;}') | ||
echo $city $summ | ||
done | sort -r -n -k2 | head -$count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
id user city phone | ||
|
||
1 test Omsk 53984123 | ||
|
||
2 test2 Moscow 1234123 | ||
|
||
3 test3 Saint-P 1232121 | ||
|
||
4 test4 Tver 4352124 | ||
|
||
5 test5 Milan 7990923 | ||
|
||
6 test6 Moscow 908213 | ||
|
||
7 test7 Omsk 12682543 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?php | ||
Check failure on line 1 in code/index.php
|
||
echo "Hello, Otus!"; | ||
|
||
phpinfo(); | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
|
||
version: '3' | ||
|
||
services: | ||
app: | ||
build: | ||
context: Docker/fpm | ||
dockerfile: Dockerfile | ||
image: myapp/php | ||
container_name: app | ||
volumes: | ||
- ./Docker/code:/data/application.local | ||
- "phpsocket:/var/run" | ||
networks: | ||
- app-network | ||
|
||
webserver: | ||
build: | ||
context: Docker/nginx | ||
dockerfile: Dockerfile | ||
image: myapp/nginx | ||
container_name: webserver | ||
ports: | ||
- "8080:80" | ||
- "443:443" | ||
volumes: | ||
- ./Docker/code:/data/application.local | ||
- "phpsocket:/var/run" | ||
networks: | ||
- app-network | ||
|
||
memcached: | ||
image: memcached:latest | ||
ports: | ||
- "11211:11211" | ||
networks: | ||
- app-network | ||
|
||
redis: | ||
image: redis:latest | ||
ports: | ||
- "6379:6379" | ||
networks: | ||
- app-network | ||
|
||
postgres_db: | ||
image: postgres:latest | ||
container_name: db | ||
restart: always | ||
environment: | ||
- POSTGRES_USER=${POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
ports: | ||
- '5432:5432' | ||
volumes: | ||
- postgres_db:/var/lib/postgresql/data | ||
|
||
|
||
volumes: | ||
postgres_db: | ||
driver: local | ||
phpsocket: | ||
networks: | ||
app-network: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# версия синтаксиса | ||
version: '3' | ||
|
||
# в этом блоке мы описываем контейнеры, которые будут запускаться | ||
services: | ||
|
||
#Контейнер с PHP, назовём его app | ||
app: | ||
# Если нет секции build, то система будет искать образ в репозиториях | ||
build: | ||
context: ./fpm | ||
dockerfile: Dockerfile | ||
image: myapp/php # имя будущего образа | ||
container_name: app # имя контейнера после запуска | ||
volumes: | ||
- ./code:/data/mysite.local | ||
# мы можем создать для контейнеров внутреннюю сеть | ||
networks: | ||
- app-network | ||
|
||
#контейне с Nginx | ||
webserver: | ||
build: | ||
context: ./nginx | ||
dockerfile: Dockerfile | ||
image: myapp/nginx | ||
container_name: webserver | ||
volumes: | ||
- ./code:/data/mysite.local | ||
# проброс портов | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
networks: | ||
- app-network | ||
|
||
#MySQL Service | ||
db: | ||
image: mysql:5.7.22 | ||
container_name: db | ||
ports: | ||
- "3306:3306" | ||
environment: | ||
MYSQL_DATABASE: ${MYSQL_DATABASE} | ||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} | ||
networks: | ||
- app-network | ||
volumes: | ||
- ./dbdata:/var/lib/mysql | ||
|
||
#Docker Networks | ||
networks: | ||
app-network: | ||
driver: bridge |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если запустить без аргументов - просто висит.