Skip to content

Commit cc3c0d2

Browse files
committed
fixed kpi
1 parent a74e349 commit cc3c0d2

File tree

9 files changed

+56
-39
lines changed

9 files changed

+56
-39
lines changed

docker-config/kpi/.env

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
APP_ENV=local
1+
APP_ENV=production
22
APP_KEY=base64:77OgH/oKeS0eg4yCcTPDZhmwYExYb7+eVhOXlBGfpo4=
33
APP_DEBUG=true
44
APP_LOG_LEVEL=debug
5-
APP_URL=http://localhost
6-
APP_THEME=default
5+
APP_URL=http://apps.openbudgets.eu/kpi
6+
APP_THEME=obeu
77
REGISTRATION_ENABLED=false
88
VALUE_CACHE=true
9-
CACHE_TIME=120
9+
CACHE_TIME=1200000000000
1010
LANG_DETECTOR_LANGUAGES=en,el
11+
L5_SWAGGER_BASE_PATH=/kpi/api/v1
1112

1213

1314
DB_CONNECTION=sqlite
15+
DB_DATABASE=/var/www/database/database.sqlite
1416

1517
BROADCAST_DRIVER=log
1618
CACHE_DRIVER=file
1719
SESSION_DRIVER=file
1820
QUEUE_DRIVER=sync
1921

20-
ENDPOINT="http://data.openbudgets.eu/sparql"
21-
RUDOLF=http://eis-openbudgets.iais.fraunhofer.de/api/3/cubes/
22+
ENDPOINT=http://data.openbudgets.eu/sparql
23+
RUDOLF=http://apps.openbudgets.eu/api/3/cubes/
2224
INDIGO=http://apps.openbudgets.eu/
2325
INDIGO_ROUTE=#indigo/cube/analytics/
24-
OS_VIEWER=http://eis-openbudgets.iais.fraunhofer.de/viewer/
26+
OS_VIEWER=http://apps.openbudgets.eu/viewer/
2527
GEONAMES_ENDPOINT="http://factforge.net/repositories/ff-news?infer=false&sameAs=false&"

docker-config/kpi/Dockerfile

+10-11
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,22 @@ ENV APACHE_DOC_ROOT /var/www/KPIs/public/
4141
ENV APP_DIR /var/www/KPIs
4242
WORKDIR $APP_DIR
4343

44-
RUN git clone https://github.com/okgreece/KPIs.git $APP_DIR && \
45-
git checkout master
44+
ADD https://api.github.com/repos/okgreece/KPIs/git/refs/heads/master /version.json
45+
RUN rm -r $APP_DIR
46+
RUN git clone https://github.com/okgreece/KPIs.git $APP_DIR/
4647

47-
COPY ./.env $APP_DIR/.env
48+
RUN mkdir -p /root/.composer
49+
COPY ./prod/apache2.conf /etc/apache2/apache2.conf
50+
RUN mkdir -p /var/www/database
4851
RUN composer install
52+
RUN touch /var/www/database/database.sqlite
53+
COPY ./.env $APP_DIR/.env
4954
RUN php artisan key:generate
50-
RUN touch database/database.sqlite
51-
RUN php artisan migrate --seed
55+
RUN php artisan migrate --seed --force
56+
RUN php artisan l5-swagger:generate
5257
RUN chmod -R a+rwx $APP_DIR
5358

54-
#COPY ./database.sqlite /database.sqlite
55-
#RUN chmod a+rwx /database.sqlite
56-
5759
EXPOSE 80
5860
COPY ./start.sh /start.sh
5961
COPY ./.env /.env
6062
CMD ["/bin/sh", "/start.sh"]
61-
62-
63-

docker-config/kpi/database.sqlite

Whitespace-only changes.

docker-config/kpi/start.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -e
99
echo "date.timezone = $PHP_TIMEZONE" > /usr/local/etc/php/conf.d/timezone.ini
1010

1111
# Change file permissions of sqlite:
12-
chmod a+rwx $APP_DIR/storage/database.sqlite
12+
chown www-data:www-data /var/www/database/database.sqlite
1313

1414
# Configure Apache Document Root
1515
mkdir -p $APACHE_DOC_ROOT
@@ -22,4 +22,3 @@ echo "</Directory>" >> /etc/apache2/conf-available/document-root-directory.conf
2222
a2enconf "document-root-directory.conf"
2323

2424
exec "apache2-foreground"
25-

docker-config/nginx/conf/includes/http_server_eis_obeu.conf

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ server {
1515
###################### Include Apps ###########################
1616

1717
include includes/locations/linkedpipes.conf;
18-
18+
1919
include includes/locations/okgr_apps.conf;
2020

2121
include includes/locations/kpi.conf;
22-
22+
2323
# include includes/locations/microsite.conf;
24-
24+
2525
include includes/locations/cors-anywhere.conf;
2626

2727
include includes/locations/os_apps.conf;
2828

2929
include includes/locations/staticfiles.conf;
3030

3131
include includes/locations/dam.conf;
32-
32+
3333
include includes/locations/alignment_http.conf;
34-
34+
3535
include includes/locations/opencpu.conf;
36-
36+
3737
######################### Lets encrypt ############################
3838

3939
location /.well-known {
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
location /kpi/ {
22
add_header Strict-Transport-Security "max-age=0; includeSubdomains;";
33
add_header Cache-Control "no-store, no-cache, must-revalidate";
4-
expires -1;
4+
expires -1;
5+
proxy_set_header Host $host;
6+
proxy_set_header X-Real-IP $remote_addr;
7+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
8+
proxy_set_header X-Forwarded-Proto $scheme;
59
proxy_pass http://kpi:80/;
610
}

docker-config/prod.yml

+20-8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@ services:
1616
- OS_API=http://apps.openbudgets.eu/api/3
1717
env_file:
1818
- ../.env
19+
obeu_microsite:
20+
image: openbudgets/microsite
21+
build: ./obeu-microsite
22+
volumes:
23+
- ../volumes/osviewer/themes:/microsite/os_viewer_themes
24+
- ../volumes/microsite/data/db.sqlite3:/microsite/db.sqlite3
25+
ports:
26+
- "8009:8000"
27+
links:
28+
- os-viewer
29+
environment:
30+
- OS_VIEWER_THEMES_FOLDER=os_viewer_themes
31+
- OS_VIEWER_HOST=http://apps.openbudgets.eu/viewer
32+
- OS_API=http://apps.openbudgets.eu/api/3
33+
env_file:
34+
- ../.env
1935
silkworkbench:
2036
image: openbudgets/silkworkbench
2137
build: ./silkworkbench
@@ -266,16 +282,11 @@ services:
266282
image: openbudgets/kpi
267283
build: ./kpi
268284
volumes:
269-
- ../volumes/kpi/database/database.sqlite:/var/www/KPIs/storage/database.sqlite
270-
- ./kpi/dev/apache2.conf:/etc/apache2/apache2.conf
285+
- ../volumes/kpi/database:/var/www/database
286+
#- ./kpi/dev/apache2.conf:/etc/apache2/apache2.conf
287+
- ../volumes/kpi/composer:/root/.composer
271288
ports:
272289
- "8112:80"
273-
links:
274-
- rudolf
275-
- virtuoso_staging
276-
- virtuoso_production
277-
- indigo
278-
- os-viewer
279290
damapp:
280291
image: openbudgets/damapp
281292
build: ./damapp
@@ -321,6 +332,7 @@ services:
321332
- rdfbrowser
322333
- alignment
323334
- microsite
335+
- obeu_microsite
324336
- damapp
325337
- opencpu
326338
- cors

initVolumes.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ mkdir -p volumes/rdfbrowser/storage
5858
#KPIs:
5959
mkdir -p volumes/kpi/logs
6060
mkdir -p volumes/kpi/database
61-
#[ ! -f volumes/kpi/database/database.sqlite ] && cp ./docker-config/kpi/database.sqlite ./volumes/kpi/database/database.sqlite
61+
mkdir -p volumes/kpi/composer
62+
[ ! -f volumes/kpi/database/database.sqlite ] && cp ./docker-config/kpi/database.sqlite ./volumes/kpi/database/database.sqlite
6263

6364
#opencpu:
6465
mkdir -p volumes/opencpu/scripts

refresh_and_restart_prod.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env /bin/sh
22

3-
git pull origin master
3+
#git pull origin master
44
export COMPOSE_HTTP_TIMEOUT=200
55
export GOMAXPROCS=4
66
OBEU_WORKDIR=$PWD
77

88
# -- build: Only rebuilding Images that have changed
99
# -- build: Only rebuilding Images that have changed
1010
cd $OBEU_WORKDIR/docker-config && \
11-
docker-compose -f prod.yml up --build -d --remove-orphans
11+
#docker-compose -f prod.yml up --build -d --remove-orphans
1212
# For Pulling new Base Images and build from scratch:
13-
# docker-compose -f prod.yml up --build -d --remove-orphans --force-recreate
13+
docker-compose -f prod.yml up --build -d --remove-orphans --force-recreate

0 commit comments

Comments
 (0)