infra: dusting
This commit is contained in:
parent
93519e5f62
commit
8edc8e697c
5 changed files with 68 additions and 39 deletions
|
@ -30,4 +30,4 @@ COPY admin/static/css/bootstrap.min.css frontend/static/css/glyphicon.css /srv/h
|
||||||
COPY frontend/static/fonts /srv/htdocs-admin/fonts
|
COPY frontend/static/fonts /srv/htdocs-admin/fonts
|
||||||
COPY admin/static/img /srv/htdocs-admin/img
|
COPY admin/static/img /srv/htdocs-admin/img
|
||||||
COPY admin/static/views /srv/htdocs-admin/views
|
COPY admin/static/views /srv/htdocs-admin/views
|
||||||
COPY admin/static/js/app.js frontend/static/js/angular.min.js admin/static/js/angular-resource.min.js frontend/static/js/angular-route.min.js frontend/static/js/angular-sanitize.min.js frontend/static/js/bootstrap.min.js frontend/static/js/d3.v3.min.js frontend/static/js/i18n frontend/static/js/jquery.min.js frontend/static/js/popper.min.js /srv/htdocs-admin/js/
|
COPY admin/static/js/app.js frontend/static/js/angular.min.js admin/static/js/angular-resource.min.js frontend/static/js/angular-route.min.js frontend/static/js/angular-sanitize.min.js frontend/static/js/bootstrap.min.js frontend/static/js/common.js frontend/static/js/d3.v3.min.js frontend/static/js/i18n frontend/static/js/jquery.min.js /srv/htdocs-admin/js/
|
||||||
|
|
|
@ -6,6 +6,7 @@ WORKDIR /go/src/srs.epita.fr/fic-server/dashboard
|
||||||
|
|
||||||
ADD dashboard/*.go ./
|
ADD dashboard/*.go ./
|
||||||
ADD dashboard/api/*.go ./api/
|
ADD dashboard/api/*.go ./api/
|
||||||
|
ADD libfic ../libfic/
|
||||||
ADD settings ../settings/
|
ADD settings ../settings/
|
||||||
|
|
||||||
RUN go get -d -v
|
RUN go get -d -v
|
||||||
|
@ -23,4 +24,8 @@ ENTRYPOINT ["/srv/dashboard", "--bind=:8082"]
|
||||||
VOLUME /srv/htdocs-dashboard/
|
VOLUME /srv/htdocs-dashboard/
|
||||||
|
|
||||||
COPY --from=gobuild /go/src/srs.epita.fr/fic-server/dashboard/dashboard /srv/dashboard
|
COPY --from=gobuild /go/src/srs.epita.fr/fic-server/dashboard/dashboard /srv/dashboard
|
||||||
COPY dashboard/static /srv/htdocs-dashboard
|
COPY dashboard/static/index.html /srv/htdocs-dashboard/
|
||||||
|
COPY dashboard/static/css/bootstrap.min.css frontend/static/css/fic.css frontend/static/css/glyphicon.css /srv/htdocs-dashboard/css/
|
||||||
|
COPY frontend/static/fonts /srv/htdocs-dashboard/fonts
|
||||||
|
COPY frontend/static/img/ dashboard/static/img/logo-epita-bw.png /srv/htdocs-dashboard/img/
|
||||||
|
COPY dashboard/static/js/dashboard.js frontend/static/js/angular.min.js dashboard/static/js/angular-animate.min.js frontend/static/js/angular-route.min.js frontend/static/js/angular-sanitize.min.js frontend/static/js/bootstrap.min.js frontend/static/js/common.js frontend/static/js/d3.v3.min.js frontend/static/js/i18n frontend/static/js/jquery.min.js /srv/htdocs-dashboard/js/
|
||||||
|
|
|
@ -53,6 +53,9 @@ server {
|
||||||
location /rank {
|
location /rank {
|
||||||
rewrite ^/.*$ /index.html;
|
rewrite ^/.*$ /index.html;
|
||||||
}
|
}
|
||||||
|
location /rules {
|
||||||
|
rewrite ^/.*$ /index.html;
|
||||||
|
}
|
||||||
location /tags/ {
|
location /tags/ {
|
||||||
rewrite ^/.*$ /index.html;
|
rewrite ^/.*$ /index.html;
|
||||||
}
|
}
|
||||||
|
@ -78,11 +81,6 @@ server {
|
||||||
expires epoch;
|
expires epoch;
|
||||||
add_header Cache-Control no-cache;
|
add_header Cache-Control no-cache;
|
||||||
}
|
}
|
||||||
location /public.json {
|
|
||||||
root /srv/TEAMS/_public/;
|
|
||||||
expires epoch;
|
|
||||||
add_header Cache-Control no-cache;
|
|
||||||
}
|
|
||||||
location /stats.json {
|
location /stats.json {
|
||||||
root /srv/TEAMS/;
|
root /srv/TEAMS/;
|
||||||
expires epoch;
|
expires epoch;
|
||||||
|
@ -98,13 +96,14 @@ server {
|
||||||
expires epoch;
|
expires epoch;
|
||||||
add_header Cache-Control no-cache;
|
add_header Cache-Control no-cache;
|
||||||
|
|
||||||
#if (!-f $document_root/../started) {
|
if (!-f $document_root/../started) {
|
||||||
# rewrite ^/ /wait.json;
|
rewrite ^/ /wait.json;
|
||||||
#}
|
}
|
||||||
}
|
}
|
||||||
location /settings.json {
|
location /settings.json {
|
||||||
root /srv/TEAMS/;
|
root /srv/SETTINGS/;
|
||||||
expires epoch;
|
expires epoch;
|
||||||
|
add_header X-FIC-time $msec;
|
||||||
add_header Cache-Control no-cache;
|
add_header Cache-Control no-cache;
|
||||||
}
|
}
|
||||||
location /teams.json {
|
location /teams.json {
|
||||||
|
@ -126,9 +125,8 @@ server {
|
||||||
return 403;
|
return 403;
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_pass http://localhost:8081/admin/api/;
|
proxy_pass http://fic-admin:8081/admin/api/;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_set_header Host localhost;
|
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,9 +138,8 @@ server {
|
||||||
return 403;
|
return 403;
|
||||||
}
|
}
|
||||||
|
|
||||||
proxy_pass http://localhost:8081;
|
proxy_pass http://fic-admin:8081;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_set_header Host localhost;
|
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,9 +151,8 @@ server {
|
||||||
|
|
||||||
rewrite ^/submit/(.*)$ /submission/$team/$1 break;
|
rewrite ^/submit/(.*)$ /submission/$team/$1 break;
|
||||||
|
|
||||||
proxy_pass http://localhost:8080/;
|
proxy_pass http://fic-frontend:8080/;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_set_header Host localhost;
|
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,9 +164,21 @@ server {
|
||||||
|
|
||||||
rewrite ^/submit/.*$ /chname/$team break;
|
rewrite ^/submit/.*$ /chname/$team break;
|
||||||
|
|
||||||
proxy_pass http://localhost:8080/;
|
proxy_pass http://fic-frontend:8080/;
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /registration {
|
||||||
|
#auth_basic "Secure Zone";
|
||||||
|
#auth_basic_user_file ficpasswd;
|
||||||
|
|
||||||
|
include /etc/nginx/auth.conf;
|
||||||
|
|
||||||
|
rewrite ^/registration /registration/$team break;
|
||||||
|
|
||||||
|
proxy_pass http://fic-frontend:8080;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_set_header Host localhost;
|
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,9 +190,8 @@ server {
|
||||||
|
|
||||||
rewrite ^/openhint/(.*)$ /openhint/$team/$1 break;
|
rewrite ^/openhint/(.*)$ /openhint/$team/$1 break;
|
||||||
|
|
||||||
proxy_pass http://localhost:8080/;
|
proxy_pass http://fic-frontend:8080/;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_set_header Host localhost;
|
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,19 +203,17 @@ server {
|
||||||
|
|
||||||
rewrite ^/wantchoices/(.*)$ /wantchoices/$team/$1 break;
|
rewrite ^/wantchoices/(.*)$ /wantchoices/$team/$1 break;
|
||||||
|
|
||||||
proxy_pass http://localhost:8080/;
|
proxy_pass http://fic-frontend:8080/;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_set_header Host localhost;
|
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /events.json {
|
location = /events.json {
|
||||||
proxy_pass http://localhost:8081/api/events/;
|
proxy_pass http://fic-admin:8081/api/events/;
|
||||||
proxy_method GET;
|
proxy_method GET;
|
||||||
proxy_pass_request_body off;
|
proxy_pass_request_body off;
|
||||||
proxy_set_header Content-Length "";
|
proxy_set_header Content-Length "";
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_set_header Host localhost;
|
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
proxy_cache STATIC;
|
proxy_cache STATIC;
|
||||||
proxy_cache_valid 3s;
|
proxy_cache_valid 3s;
|
||||||
|
|
|
@ -36,9 +36,6 @@ server {
|
||||||
location = /index.html {
|
location = /index.html {
|
||||||
include fic-auth.conf;
|
include fic-auth.conf;
|
||||||
}
|
}
|
||||||
location ~ ^/public[0-9].html {
|
|
||||||
rewrite ^ /public.html;
|
|
||||||
}
|
|
||||||
location = /welcome.html {
|
location = /welcome.html {
|
||||||
internal;
|
internal;
|
||||||
if ($http_accept ~ "^application/json") {
|
if ($http_accept ~ "^application/json") {
|
||||||
|
@ -109,11 +106,6 @@ server {
|
||||||
expires epoch;
|
expires epoch;
|
||||||
add_header Cache-Control no-cache;
|
add_header Cache-Control no-cache;
|
||||||
}
|
}
|
||||||
location ~ /public[0-9].json {
|
|
||||||
root /srv/TEAMS/public/;
|
|
||||||
expires epoch;
|
|
||||||
add_header Cache-Control no-cache;
|
|
||||||
}
|
|
||||||
location /stats.json {
|
location /stats.json {
|
||||||
root /srv/TEAMS/;
|
root /srv/TEAMS/;
|
||||||
expires epoch;
|
expires epoch;
|
||||||
|
@ -170,6 +162,15 @@ server {
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
}
|
}
|
||||||
|
location /registration {
|
||||||
|
include fic-auth.conf;
|
||||||
|
|
||||||
|
rewrite ^/registration /registration/$team break;
|
||||||
|
|
||||||
|
proxy_pass http://frontend:8080;
|
||||||
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
|
proxy_redirect off;
|
||||||
|
}
|
||||||
location /openhint/ {
|
location /openhint/ {
|
||||||
include fic-auth.conf;
|
include fic-auth.conf;
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,12 @@ services:
|
||||||
links:
|
links:
|
||||||
- mysql
|
- mysql
|
||||||
volumes:
|
volumes:
|
||||||
- ~/fic:/mnt/fic:ro
|
- /mnt/fic:/mnt/fic:ro
|
||||||
|
- dashboard:/srv/DASHBOARD
|
||||||
- files:/srv/FILES
|
- files:/srv/FILES
|
||||||
- pki:/srv/PKI
|
- pki:/srv/PKI
|
||||||
- settings:/srv/SETTINGS
|
- settings:/srv/SETTINGS
|
||||||
- teams:/srv/TEAMS
|
- teams:/srv/TEAMS:ro
|
||||||
command: --baseurl /admin/ -localimport /mnt/fic -localimportsymlink
|
command: --baseurl /admin/ -localimport /mnt/fic -localimportsymlink
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
|
@ -41,9 +42,9 @@ services:
|
||||||
links:
|
links:
|
||||||
- mysql
|
- mysql
|
||||||
volumes:
|
volumes:
|
||||||
- files:/srv/FILES
|
- files:/srv/FILES:ro
|
||||||
- teams:/srv/TEAMS
|
- teams:/srv/TEAMS
|
||||||
- settings:/srv/SETTINGS
|
- settings:/srv/SETTINGS:ro
|
||||||
- submissions:/srv/submissions
|
- submissions:/srv/submissions
|
||||||
depends_on:
|
depends_on:
|
||||||
- mysql
|
- mysql
|
||||||
|
@ -58,23 +59,39 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- htdocs:/srv/htdocs-frontend
|
- htdocs:/srv/htdocs-frontend:ro
|
||||||
- files:/srv/FILES:ro
|
- files:/srv/FILES:ro
|
||||||
- teams:/srv/TEAMS:ro
|
- teams:/srv/TEAMS:ro
|
||||||
- settings:/srv/SETTINGS
|
- settings:/srv/SETTINGS:ro
|
||||||
- submissions:/srv/submissions
|
- submissions:/srv/submissions
|
||||||
depends_on:
|
depends_on:
|
||||||
- fic-backend
|
- fic-backend
|
||||||
|
|
||||||
|
fic-dashboard:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-dashboard
|
||||||
|
image: nemunaire/fic-dashboard:latest
|
||||||
|
ports:
|
||||||
|
- "8082:8082"
|
||||||
|
volumes:
|
||||||
|
- dashboard:/srv/DASHBOARD
|
||||||
|
- teams:/srv/TEAMS:ro
|
||||||
|
- settings:/srv/SETTINGS:ro
|
||||||
|
depends_on:
|
||||||
|
- fic-backend
|
||||||
|
|
||||||
front:
|
front:
|
||||||
image: nginx:latest
|
image: nginx:latest
|
||||||
ports:
|
ports:
|
||||||
- "8042:80"
|
- "8042:80"
|
||||||
volumes:
|
volumes:
|
||||||
|
- /mnt/fic:/mnt/fic:ro
|
||||||
- ./configs/nginx-frontend-htpasswd.conf:/etc/nginx/conf.d/default.conf:ro
|
- ./configs/nginx-frontend-htpasswd.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
- ./configs/nginx-fic.conf:/etc/nginx/auth.conf:ro
|
- ./configs/nginx-fic.conf:/etc/nginx/auth.conf:ro
|
||||||
- htdocs:/srv/htdocs-frontend:ro
|
- htdocs:/srv/htdocs-frontend:ro
|
||||||
- files:/srv/FILES:ro
|
- files:/srv/FILES:ro
|
||||||
|
- settings:/srv/SETTINGS:ro
|
||||||
- teams:/srv/TEAMS:ro
|
- teams:/srv/TEAMS:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
- fic-frontend
|
- fic-frontend
|
||||||
|
@ -82,6 +99,7 @@ services:
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mysql-data:
|
mysql-data:
|
||||||
|
dashboard:
|
||||||
files:
|
files:
|
||||||
htdocs:
|
htdocs:
|
||||||
pki:
|
pki:
|
||||||
|
|
Reference in a new issue