Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
services:
apache-httpd:
container_name: httpd-server
# apache-httpd:
# container_name: httpd-server-apache
# build:
# context: ./httpd/
# dockerfile: ./Dockerfile-apache
# args:
# - APACHE_LOG_DIR="/var/log/httpd-server/"
# restart: on-failure
# ports:
# - "8080:80"
# networks:
# - internal_net

nginx-httpd:
container_name: httpd-server-nginx
build:
context: ./httpd/
args:
- APACHE_LOG_DIR="/var/log/httpd-server/"
dockerfile: ./Dockerfile-nginx
restart: on-failure
ports:
- "8080:80"
Expand All @@ -17,7 +29,8 @@ services:
context: ./server/
restart: on-failure
depends_on:
- apache-httpd
# - apache-httpd
- nginx-httpd
networks:
- internal_net

Expand Down
4 changes: 2 additions & 2 deletions httpd/Dockerfile → httpd/Dockerfile-apache
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ COPY ./static/ /var/www/localhost/htdocs/static/

# add custom apache configs
RUN mkdir -p /etc/apache2/conf-custom
COPY ./conf/custom/ /etc/apache2/conf-custom/
COPY ./apache-conf/custom/ /etc/apache2/conf-custom/

# create logs directory (temporary disabled)
ARG APACHE_LOG_DIR
RUN mkdir -p ${APACHE_LOG_DIR}
RUN chown www-data:www-data ${APACHE_LOG_DIR}

# setup main apache configuration
COPY ./conf/httpd.conf /usr/local/apache2/conf/httpd.conf
COPY ./apache-conf/httpd.conf /usr/local/apache2/conf/httpd.conf

EXPOSE 80
7 changes: 7 additions & 0 deletions httpd/Dockerfile-nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM nginx:latest

COPY /nginx-conf/httpd.conf /etc/nginx/conf.d/default.conf
COPY ./static/ /var/www/html/

EXPOSE 80
#EXPOSE 443
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
# FastCGI server setup start
# ==========================

ProxyPass /fcgi-bin/ fcgi://fastcgi-server:55555/
ProxyPassReverse /fcgi-bin/ fcgi://fastcgi-server:55555/
ProxyPass /fcgi/ fcgi://fastcgi-server:55555/
ProxyPassReverse /fcgi/ fcgi://fastcgi-server:55555/

<Location "/fcgi-bin/">
<Location "/fcgi/">
Require all granted
</Location>

Expand Down
File renamed without changes.
18 changes: 18 additions & 0 deletions httpd/nginx-conf/httpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
server {
listen 80;

root /var/www/html;

# Обработка статических файлов
location / {
try_files $uri $uri/ =404;
}

location /fcgi/ {
# Базовые настройки FastCGI
include fastcgi_params;

# Адрес FastCGI сервера
fastcgi_pass fastcgi-server:55555;
}
}
24 changes: 23 additions & 1 deletion httpd/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,29 @@ <h3 class="history-title">История введенных данных</h3>
const Y = document.getElementById('Y').value;

if (X && R && Y) {
sendAJAXGETRequest("/fcgi-bin/", {"x": X, "y": Y, "r": R}, (resp) => {FFCGIResponceHandler(resp, X, Y, R)});

// Stub
sendAJAXGETRequest("/fcgi/", {"x": X, "y": Y, "r": R}, (data) => {console.log(data)});
console.log(`Данные отправлены!\nX: ${X}\nY: ${Y}\nR: ${R}`);

// Сохраняем данные в историю
const formData = {
timestamp: new Date().toISOString(),
X: X,
Y: Y,
R: R,
elapsedTimeMs: 100,
isHitted: true
};

formHistory.push(formData);
localStorage.setItem('formHistory', JSON.stringify(formHistory));

// Обновляем таблицу
refreshHistoryTable();

// Обновляем график
refreshGraph();

// Очищаем форму
this.reset();
Expand Down
9 changes: 1 addition & 8 deletions server/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.