Skip to content

Commit

Permalink
Update docs and docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
CAPCHIK committed Jan 22, 2024
1 parent 8f1ed74 commit ca89f27
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 106 deletions.
10 changes: 0 additions & 10 deletions Proxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
FROM nginx:alpine

RUN apk add --no-cache --update apache2-utils

COPY proxy.conf /etc/nginx/conf.d/proxy.conf
COPY 502.html /usr/share/nginx/html/502.html
COPY 404.html /usr/share/nginx/html/404.html
COPY 401.html /usr/share/nginx/html/401.html

COPY run.sh /run.sh
RUN sed -i $'s/\r$//' /run.sh
RUN chmod +x /run.sh

STOPSIGNAL SIGQUIT

ENTRYPOINT ["/run.sh"]
34 changes: 0 additions & 34 deletions Proxy/proxy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,40 +34,6 @@ server {
proxy_set_header Host $host;
}

location /admin {
set $upstream_admin 'admin:5503';
proxy_pass http://$upstream_admin;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;

auth_basic "Administrator’s Area";
auth_basic_user_file /etc/nginx/admin.htpasswd;
}

location /results-viewer {
location /results-viewer {
set $upstream_results_viewer 'results-viewer:5504';
proxy_pass http://$upstream_results_viewer;
}

location /results-viewer/pdfprint {
set $upstream_pdf_printer 'pdf-printer:80';
proxy_pass http://$upstream_pdf_printer/print;
client_max_body_size 10M;
}

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;

auth_basic "Result viewer Area";
auth_basic_user_file /etc/nginx/results-viewer.htpasswd;
}

location /control-panel {
set $upstream_control_panel 'control-panel:5505';
proxy_pass http://$upstream_control_panel;
Expand Down
31 changes: 0 additions & 31 deletions Proxy/run.sh

This file was deleted.

16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,25 @@ odc up -d
Create file `environment.ps1` (already in `.gitignore`)
```powershell
$Env:JWT_SECRET_KEY="key for jwt"
$Env:SECRET_ADMIN_KEY="adminservice key for api requests"
$Env:OLYMPIAD_DOMAIN="target domain"
$Env:OLYMPIAD_PRIVATE_REGISTRY_ADDRESS="your private registry for executor domain"
$Env:OLYMPIAD_PRIVATE_REGISTRY_LOGIN="your private registry for executor login"
$Env:OLYMPIAD_PRIVATE_REGISTRY_PASSWORD="your private registry for executor password"
$Env:BASIC_AUTH_USERNAME="login for admin service"
$Env:BASIC_AUTH_PASSWORD="password for admin service"
$Env:POSTGRES_CONNECTION_STRING="Connection string for peoduction database"
$Env:RABBITMQ_PASSWORD="password for internal communication in rabbitmq"
$Env:GENERATE_USER_EMAIL_DOMAIN="domain to generate user accounts, like localhost.ru"
$Env:POSTGRES_CONNECTION_STRING="Connection string for production database"
$Env:EXECUTOR_USER_LOGIN="executor account login"
$Env:EXECUTOR_USER_PASSWORD="executor account password. CHANGE PASSWORD AFTER AUTO CREATING!"
$Env:S3_SERVICE_URL="s3 service address like storage.yandexcloud.net"
$Env:S3_SERVICE_ACCESS_KEY_ID="s3 key id"
$Env:S3_SERVICE_SECRET_ACCESS_KEY="s3 key secret"
$Env:S3_SERVICE_FORCE_PATH_STYLE="true if local like zenko, false id provider accepts bucket as subdomain"
$Env:S3_SERVICE_BUCKET_NAME="s3 bucket name"
```

Invoke
```powershell
. .\environment.ps1 ;; .\genStack.ps1
. .\alias.ps1 ;; . .\environment.ps1 ;; .\genStack.ps1
```

Use `stack.yml` file to publish service to `docker swarm`
9 changes: 0 additions & 9 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@ version: "3.8"
services:
proxy:
build: Proxy
environment:
- BASIC_AUTH_USERNAME=admin
- BASIC_AUTH_PASSWORD=VeryStrongPassword1
- BASIC_AUTH_USERNAME_ADMIN=admin
- BASIC_AUTH_PASSWORD_ADMIN=VeryStrongPassword1

- BASIC_AUTH_USERNAME_RESULTS_VIEWER=results-viewer
- BASIC_AUTH_PASSWORD_RESULTS_VIEWER=VeryStrongPassword1

ports:
- 5500:5500
restart: on-failure
15 changes: 0 additions & 15 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,20 @@ version: "3.8"

services:
proxy:
environment:
- BASIC_AUTH_USERNAME_ADMIN=${BASIC_AUTH_USERNAME_ADMIN?Create basic auth username for admin service BASIC_AUTH_USERNAME_ADMIN}
- BASIC_AUTH_PASSWORD_ADMIN=${BASIC_AUTH_PASSWORD_ADMIN?Create basic auth password for admin service BASIC_AUTH_PASSWORD_ADMIN}

- BASIC_AUTH_USERNAME_RESULTS_VIEWER=${BASIC_AUTH_USERNAME_RESULTS_VIEWER?Create basic auth username for results viewer service BASIC_AUTH_USERNAME_RESULTS_VIEWER}
- BASIC_AUTH_PASSWORD_RESULTS_VIEWER=${BASIC_AUTH_PASSWORD_RESULTS_VIEWER?Create basic auth password for results viewer service BASIC_AUTH_PASSWORD_RESULTS_VIEWER}
networks:
- net
api:
networks:
- net
admin:
networks:
- net
front:
networks:
- net
executor:
networks:
- net
results-viewer:
networks:
- net
control-panel:
networks:
- net
pdf-printer:
networks:
- net
rabbitmq:
networks:
- net
Expand Down

0 comments on commit ca89f27

Please sign in to comment.