Compare commits
139
Commits
nginx-proxy
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe99df7339 | ||
|
|
2d36a12966 | ||
|
|
665a8f005f | ||
|
|
1443588a11 | ||
|
|
a7d89f4ebb | ||
|
|
c1fe629589 | ||
|
|
a9860c79da | ||
|
|
8ea27d3701 | ||
|
|
8282acffd4 | ||
|
|
02d923e064 | ||
|
|
8a7f62e955 | ||
|
|
66d1d722c3 | ||
|
|
a9db81d292 | ||
|
|
0962464c8d | ||
|
|
4e861c276a | ||
|
|
24df0ab253 | ||
|
|
4f56a7c8db | ||
|
|
8b69854af5 | ||
|
|
f0b7f21bc6 | ||
|
|
578cfec628 | ||
|
|
062db05406 | ||
|
|
b91a1bb855 | ||
|
|
999985c45e | ||
|
|
2086e9f3d2 | ||
|
|
0879ec6185 | ||
|
|
56104de8a3 | ||
|
|
f0f67b5182 | ||
|
|
a0c1fec080 | ||
|
|
0ddcd650ee | ||
|
|
4efccc1421 | ||
|
|
647cd93cd2 | ||
|
|
d4e70aa5d2 | ||
|
|
cfda98a478 | ||
|
|
7d71e616a0 | ||
|
|
0d2d8ec548 | ||
|
|
c14b7ab8af | ||
|
|
0065009a28 | ||
|
|
5ff77b9cb1 | ||
|
|
34ff18b0bd | ||
|
|
29d31a172f | ||
|
|
e509db16a6 | ||
|
|
3c70fe7a1e | ||
|
|
5ba190b8d7 | ||
|
|
8a0ebb3214 | ||
|
|
c461d5b1e4 | ||
|
|
8e84a71d83 | ||
|
|
e42a4f012c | ||
|
|
085cc3bc29 | ||
|
|
1a2297490c | ||
|
|
a25987222a | ||
|
|
f293944dcb | ||
|
|
f3550bf5c6 | ||
|
|
454d8a0bae | ||
|
|
1846475aed | ||
|
|
f438b24249 | ||
|
|
862b02584d | ||
|
|
01b1955a66 | ||
|
|
5f1dc1a71a | ||
|
|
0ca97afd07 | ||
|
|
ce41cdaeed | ||
|
|
c66592cf9f | ||
|
|
ef2f102e37 | ||
|
|
d636a2b79a | ||
|
|
4bf8adb3d9 | ||
|
|
f0af68f2c4 | ||
|
|
8b9ac95b30 | ||
|
|
8ffe23f447 | ||
|
|
5db80516bc | ||
|
|
d5b865b626 | ||
|
|
92797fee72 | ||
|
|
be1c9e8bc3 | ||
|
|
d42f6e5cb5 | ||
|
|
8505ea611f | ||
|
|
b5883150fc | ||
|
|
4ddd13640f | ||
|
|
700edfdd40 | ||
|
|
cd8ecfea69 | ||
|
|
70117bb616 | ||
|
|
c0c2a85ac4 | ||
|
|
a5c4d734c0 | ||
|
|
d70a20d3a6 | ||
|
|
1ecd244343 | ||
|
|
83cd5c8d6d | ||
|
|
4be7c33948 | ||
|
|
3b877d2fb3 | ||
|
|
c7ac1b3463 | ||
|
|
f4811c7956 | ||
|
|
0ace942135 | ||
|
|
12bad6c56f | ||
|
|
f4b5497c36 | ||
|
|
ac94d2ca2f | ||
|
|
d57c6b3c06 | ||
|
|
e50e9ac0da | ||
|
|
8a6a9de45d | ||
|
|
82ae413857 | ||
|
|
536ba0783b | ||
|
|
67bae987d7 | ||
|
|
c2c4198d39 | ||
|
|
79bcd59dab | ||
|
|
c5d790b0d8 | ||
|
|
a7eff55a91 | ||
|
|
e0bfa917fe | ||
|
|
40a0e85a1d | ||
|
|
2d5bf65663 | ||
|
|
f13756e34b | ||
|
|
69a0b22750 | ||
|
|
1e39c5e193 | ||
|
|
f0a7735a52 | ||
|
|
f27ebea7c8 | ||
|
|
bbaff95481 | ||
|
|
036eafb796 | ||
|
|
a6b67f8876 | ||
|
|
4d71f70243 | ||
|
|
75b072def9 | ||
|
|
fd867c6985 | ||
|
|
a4641ad12f | ||
|
|
b6a17ce6f2 | ||
|
|
0c5d301b88 | ||
|
|
b18f51a14e | ||
|
|
eae1735d4c | ||
|
|
9cb13b3f3d | ||
|
|
99cd77e227 | ||
|
|
8e441d3b5a | ||
|
|
3479fb6688 | ||
|
|
700a01a0d4 | ||
|
|
ed21394a25 | ||
|
|
1cf6a4ba1e | ||
|
|
fdf82583fe | ||
|
|
47ddbe61a5 | ||
|
|
8bd97b031a | ||
|
|
e125aaf39b | ||
|
|
b4328dca7b | ||
|
|
cabae621b7 | ||
|
|
24a6ff60f7 | ||
|
|
696ce52966 | ||
|
|
a0324a73ef | ||
|
|
2d291ac4e4 | ||
|
|
45b1d544d4 | ||
|
|
85c13ebf5d |
@@ -4,4 +4,5 @@ CLIENT_ROOT=./client
|
|||||||
SYNOPSX_ROOT=./synopsx
|
SYNOPSX_ROOT=./synopsx
|
||||||
WEBAPP_ROOT=./webapp
|
WEBAPP_ROOT=./webapp
|
||||||
DATA_ROOT=./data
|
DATA_ROOT=./data
|
||||||
|
FTINDEX_ROOT=./gdpFtIndex
|
||||||
LOG_ROOT=./log
|
LOG_ROOT=./log
|
||||||
|
|||||||
@@ -10,3 +10,6 @@
|
|||||||
[submodule "webapp"]
|
[submodule "webapp"]
|
||||||
path = webapp
|
path = webapp
|
||||||
url = https://github.com/guidesDeParis/webapp
|
url = https://github.com/guidesDeParis/webapp
|
||||||
|
[submodule "gdpFtIndex"]
|
||||||
|
path = gdpFtIndex
|
||||||
|
url = https://github.com/guidesDeParis/gdpFtIndex.git
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
|
# FROM basex/basexhttp:9.4.6
|
||||||
FROM basex/basexhttp:latest
|
FROM basex/basexhttp:latest
|
||||||
|
|
||||||
COPY ./bashrc /srv/.bashrc
|
# COPY ./bashrc /srv/.bashrc
|
||||||
COPY ./inputrc /srv/.inputrc
|
# COPY ./inputrc /srv/.inputrc
|
||||||
|
|
||||||
# RUN basex "db:create('gdp','/srv/basex/src/gdp.tei.xml', (),map {'ftindex': true(),'stemming': true(),'casesens': true(),'diacritics': true(),'language': 'fr','updindex': true(),'autooptimize': true(),'maxlen': 96,'maxcats': 100,'splitsize': 0,'chop': false(),'textindex': true(),'attrindex': true(),'tokenindex': true(), 'xinclude': true()})"
|
# RUN basex "db:create('gdp','/srv/basex/src/gdp.tei.xml', (),map {'ftindex': true(),'stemming': true(),'casesens': true(),'diacritics': true(),'language': 'fr','updindex': true(),'autooptimize': true(),'maxlen': 96,'maxcats': 100,'splitsize': 0,'chop': false(),'textindex': true(),'attrindex': true(),'tokenindex': true(), 'xinclude': true()})"
|
||||||
|
|
||||||
COPY ./gdp-entrypoint.sh /usr/local/bin
|
COPY ./gdp-entrypoint.sh /usr/local/bin
|
||||||
USER root
|
USER root
|
||||||
RUN chmod +x /usr/local/bin/gdp-entrypoint.sh
|
RUN chmod +x /usr/local/bin/gdp-entrypoint.sh
|
||||||
# RUN ln -s /usr/local/bin/gdp-entrypoint.sh /srv/ # backwards compat
|
# RUN chown -R basex:basex /usr/local/bin/gdp-entrypoint.sh
|
||||||
USER basex
|
# # RUN ln -s /usr/local/bin/gdp-entrypoint.sh /srv/ # backwards compat
|
||||||
|
RUN chown -R basex:basex /srv
|
||||||
|
# USER basex
|
||||||
CMD ["/bin/sh","/usr/local/bin/gdp-entrypoint.sh"]
|
CMD ["/bin/sh","/usr/local/bin/gdp-entrypoint.sh"]
|
||||||
|
|||||||
@@ -2,9 +2,41 @@
|
|||||||
|
|
||||||
# todo: run some checks
|
# todo: run some checks
|
||||||
|
|
||||||
|
id
|
||||||
|
|
||||||
|
ls -ls / | grep srv
|
||||||
|
|
||||||
echo "Creating GDP BaseX db"
|
echo "Creating GDP BaseX db"
|
||||||
basex "db:create('gdp','/srv/basex/src/gdp.tei.xml', (),map {'ftindex': true(),'stemming': true(),'casesens': true(),'diacritics': true(),'language': 'fr','updindex': true(),'autooptimize': true(),'maxlen': 96,'maxcats': 100,'splitsize': 0,'chop': false(),'textindex': true(),'attrindex': true(),'tokenindex': true(), 'xinclude': true()})"
|
basex "db:create('gdp','/srv/basex/src/gdp.tei.xml', (),map {'ftindex': true(),'stemming': true(),'casesens': true(),'diacritics': true(),'language': 'fr','updindex': true(),'autooptimize': true(),'maxlen': 96,'maxcats': 100,'splitsize': 0,'chop': false(),'textindex': true(),'attrindex': true(),'tokenindex': true(), 'xinclude': true()})"
|
||||||
|
# , 'serializer': 'indent=no'
|
||||||
|
|
||||||
|
# echo "Creating FullText Index tmp file"
|
||||||
|
# basex "xslt:transform(fn:doc('/srv/basex/src/gdp.tei.xml'), fn:doc('/srv/basex/src/xslt/generateFullTextIndex.xsl'))" > /tmp/gdpFtIndex.xml
|
||||||
|
|
||||||
|
echo "Creating FullText Index DB"
|
||||||
|
basex "db:create('gdpFtIndex', '/srv/basex/ftindex/gdpFtIndex.xml', (),map {'ftindex': true(),'stemming': true(),'casesens': true(),'diacritics': true(),'language': 'fr','updindex': true(),'autooptimize': true(),'maxlen': 96,'maxcats': 100,'splitsize': 0,'chop': false(),'textindex': true(),'attrindex': true(),'tokenindex': true(), 'xinclude': true()})"
|
||||||
|
# , 'serializer': 'indent=no'
|
||||||
|
|
||||||
|
# echo "Creating Advanced Search Index"
|
||||||
|
# basex -q "import module namespace gdp.models.tei = 'gdp.models.tei' at '/srv/basex/webapp/synopsx/workspace/gdp/models/tei.xqm' ;
|
||||||
|
# let $index := ('gdpIndexNominum', 'gdpIndexLocorum')
|
||||||
|
# return gdp.models.tei:addId2IndexedEntities($index)"
|
||||||
|
# basex "declare namespace tei = 'http://www.tei-c.org/ns/1.0' ;
|
||||||
|
# let $db := db:open('gdp')
|
||||||
|
# let $index := $db//tei:TEI[tei:teiHeader//tei:sourceDesc[@xml:id = $indexId]]
|
||||||
|
# for $occurence in fn:distinct-values($index//tei:listRelation/tei:relation/@passive ! fn:tokenize(., '\s+'))
|
||||||
|
# let $entries := $index//*[tei:listRelation/tei:relation[fn:contains(@passive, $occurence)]]
|
||||||
|
# let $element := $db//*[@xml:id = fn:substring-after($occurence, '#')]
|
||||||
|
# let $values := for $entry in $entries/@xml:id return fn:concat('#', $entry)
|
||||||
|
# return
|
||||||
|
# if ($element[fn:not(@ref)])
|
||||||
|
# then insert node attribute ref { $values } into $element
|
||||||
|
# else replace value of node $element/@ref with $values"
|
||||||
|
|
||||||
# as we override the parent container CMD, we have to launch basexhttp here
|
# as we override the parent container CMD, we have to launch basexhttp here
|
||||||
echo "Launching basexhttp"
|
echo "Launching basexhttp"
|
||||||
basexhttp
|
basexhttp
|
||||||
|
|
||||||
|
# todo never launched, prev command never ends
|
||||||
|
echo "Launching indexing"
|
||||||
|
wget -S http://localhost:8984/indexing
|
||||||
@@ -1,24 +1,68 @@
|
|||||||
FROM node:lts-alpine
|
# FROM node:lts-alpine
|
||||||
|
|
||||||
|
# RUN apk update && apk --no-cache add shadow && \
|
||||||
|
# usermod -u 1001 node && \
|
||||||
|
# groupmod -g 1001 node
|
||||||
|
|
||||||
|
# ARG UID=1000
|
||||||
|
# ARG UNAME=gdp
|
||||||
|
# ARG GID=1000
|
||||||
|
# ARG GNAME=users
|
||||||
|
|
||||||
|
# #RUN find / -group ${UID} -exec chgrp -h node {} \;
|
||||||
|
# #RUN find / -user ${UID} -exec chown -h node {} \;
|
||||||
|
|
||||||
|
# # RUN addgroup -g ${GID} ${GNAME}
|
||||||
|
# RUN if [ $(getent group ${GNAME}) ]; then echo "group ${GNAME} already exists"; else addgroup -g ${GID} ${GNAME}; fi
|
||||||
|
# # else
|
||||||
|
# # echo "group does not exist."
|
||||||
|
# # fi
|
||||||
|
# # adduser -h /home/gdp -D -u 1000 gdp && \
|
||||||
|
# RUN adduser -u ${UID} -G ${GNAME} -s /bin/sh -D ${UNAME}
|
||||||
|
# # chown -R gdp:gdp /home/gdp
|
||||||
|
|
||||||
|
# USER ${UNAME}
|
||||||
|
|
||||||
|
# COPY ./bashrc /home/${UNAME}/.bashrc
|
||||||
|
# COPY ./inputrc /home/${UNAME}/.inputrc
|
||||||
|
|
||||||
|
# COPY ./client-entrypoint.sh /usr/local/bin
|
||||||
|
# USER root
|
||||||
|
# RUN chmod +x /usr/local/bin/client-entrypoint.sh
|
||||||
|
# USER ${UNAME}
|
||||||
|
# CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]
|
||||||
|
|
||||||
|
|
||||||
|
# /////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
FROM node:16-alpine
|
||||||
|
|
||||||
RUN apk update && apk --no-cache add shadow && \
|
RUN apk update && apk --no-cache add shadow && \
|
||||||
usermod -u 1001 node && \
|
usermod -u 1001 node && \
|
||||||
groupmod -g 1001 node
|
groupmod -g 1001 node
|
||||||
|
|
||||||
RUN find / -group 1000 -exec chgrp -h node {} \;
|
# RUN find / -group 1000 -exec chgrp -h node {} \;
|
||||||
RUN find / -user 1000 -exec chown -h node {} \;
|
# RUN find / -user 1000 -exec chown -h node {} \;
|
||||||
|
|
||||||
# RUN addgroup -g 1000 gdp && \
|
ARG USER_UID
|
||||||
|
ARG USER_UNAME
|
||||||
|
ARG USER_GID
|
||||||
|
ARG USER_GNAME
|
||||||
|
|
||||||
|
RUN if [ $(getent group ${USER_GNAME}) ]; then echo "group ${USER_GNAME} already exists"; else addgroup -g ${USER_GID} ${USER_GNAME}; fi
|
||||||
|
# RUN addgroup -g 1000 ${USER_GNAME}
|
||||||
# adduser -h /home/gdp -D -u 1000 gdp && \
|
# adduser -h /home/gdp -D -u 1000 gdp && \
|
||||||
RUN adduser -u 1000 -G users -s /bin/sh -D gdp
|
RUN adduser -u ${USER_UID} -G ${USER_GNAME} -s /bin/sh -D ${USER_UNAME}
|
||||||
# chown -R gdp:gdp /home/gdp
|
# chown -R gdp:gdp /home/gdp
|
||||||
|
|
||||||
USER gdp
|
USER ${USER_UNAME}
|
||||||
|
|
||||||
COPY ./bashrc /home/gdp/.bashrc
|
COPY ./bashrc /home/${USER_UNAME}/.bashrc
|
||||||
COPY ./inputrc /home/gdp/.inputrc
|
COPY ./inputrc /home/${USER_UNAME}/.inputrc
|
||||||
|
|
||||||
COPY ./client-entrypoint.sh /usr/local/bin
|
COPY ./client-entrypoint.sh /usr/local/bin
|
||||||
USER root
|
USER root
|
||||||
RUN chmod +x /usr/local/bin/client-entrypoint.sh
|
RUN chmod +x /usr/local/bin/client-entrypoint.sh
|
||||||
USER gdp
|
USER ${USER_UNAME}
|
||||||
CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]
|
CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]
|
||||||
|
|||||||
@@ -2,10 +2,28 @@
|
|||||||
|
|
||||||
cat /etc/passwd|grep 1000
|
cat /etc/passwd|grep 1000
|
||||||
|
|
||||||
echo "Npm install"
|
|
||||||
|
|
||||||
cd /app
|
cd /app
|
||||||
npm install
|
|
||||||
|
|
||||||
|
# echo "Cleaning node_modules"
|
||||||
|
# rm -rf node_modules
|
||||||
|
|
||||||
|
# echo "Cleaning npm cache"
|
||||||
|
# npm cache clean --f
|
||||||
|
|
||||||
|
# echo "Npm install"
|
||||||
|
# npm install
|
||||||
|
|
||||||
|
echo "Npm clean install"
|
||||||
|
npm ci
|
||||||
|
|
||||||
|
# echo "Run npm dev"
|
||||||
|
# npm run dev
|
||||||
|
echo "APP_ENV $APP_ENV"
|
||||||
|
|
||||||
|
if [ "$APP_ENV" = "prod" ]; then
|
||||||
|
echo "Run npm prod"
|
||||||
|
npm run prod
|
||||||
|
else
|
||||||
echo "Run npm dev"
|
echo "Run npm dev"
|
||||||
npm run dev
|
npm run dev
|
||||||
|
fi
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
#!/usr/bin/make
|
||||||
|
|
||||||
|
SHELL = /bin/sh
|
||||||
|
|
||||||
|
USER_UID := $(shell id -u)
|
||||||
|
USER_UNAME := $(shell id -un)
|
||||||
|
USER_GID := $(shell id -g)
|
||||||
|
USER_GNAME := $(shell id -gn)
|
||||||
|
|
||||||
|
export USER_UID
|
||||||
|
export USER_UNAME
|
||||||
|
export USER_GID
|
||||||
|
export USER_GNAME
|
||||||
|
|
||||||
|
build: build_basex build_client
|
||||||
|
|
||||||
|
build_basex:
|
||||||
|
docker-compose build basex
|
||||||
|
build_client:
|
||||||
|
docker-compose build --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) client
|
||||||
|
|
||||||
|
buildnc: buildnc_basex buildnc_client
|
||||||
|
|
||||||
|
buildnc_basex:
|
||||||
|
docker-compose build --pull --no-cache basex
|
||||||
|
|
||||||
|
buildnc_client:
|
||||||
|
docker-compose build --no-cache --build-arg USER_UID=$(USER_UID) --build-arg USER_UNAME=$(USER_UNAME) --build-arg USER_GID=$(USER_GID) --build-arg USER_GNAME=$(USER_GNAME) client
|
||||||
|
|
||||||
|
up:
|
||||||
|
docker-compose up
|
||||||
|
upd:
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
|
up_basex:
|
||||||
|
docker-compose up -d basex
|
||||||
|
|
||||||
|
up_client:
|
||||||
|
docker-compose up -d client
|
||||||
|
|
||||||
|
|
||||||
|
restart_basex:
|
||||||
|
docker-compose restart basex
|
||||||
|
|
||||||
|
restart_client:
|
||||||
|
docker-compose restart client
|
||||||
|
|
||||||
|
# upbuild:
|
||||||
|
# docker-compose up -d --build
|
||||||
|
|
||||||
|
ps:
|
||||||
|
docker-compose ps
|
||||||
|
|
||||||
|
logs:
|
||||||
|
docker-compose logs -f
|
||||||
|
logs_basex:
|
||||||
|
docker-compose logs basex -f
|
||||||
|
logs_client:
|
||||||
|
docker-compose logs client -f
|
||||||
|
|
||||||
|
down:
|
||||||
|
docker-compose down
|
||||||
|
|
||||||
|
exec_client:
|
||||||
|
docker exec -it gdp-client-1 sh
|
||||||
|
|
||||||
|
exec_basex:
|
||||||
|
docker exec -it gdp-basex-1 sh
|
||||||
|
|
||||||
|
exec_basex_root:
|
||||||
|
docker exec -u 0 -it gdp-basex-1 sh
|
||||||
@@ -10,7 +10,7 @@ sudo pacman -S docker docker-compose docker-machine
|
|||||||
this will clone this repos (main docker environement) and necessary other source code (synopsx, webapp, xml-tei sources, vuejs client)
|
this will clone this repos (main docker environement) and necessary other source code (synopsx, webapp, xml-tei sources, vuejs client)
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone --recursive -o figli https://figureslibres.io/gogs/bachir/docker-gdp.git
|
git clone --recursive https://figureslibres.io/gogs/bachir/docker-gdp.git
|
||||||
```
|
```
|
||||||
|
|
||||||
## Docker
|
## Docker
|
||||||
@@ -25,31 +25,130 @@ only before the first run (may take some time)
|
|||||||
```
|
```
|
||||||
sudo docker-compose build
|
sudo docker-compose build
|
||||||
```
|
```
|
||||||
|
or with args for groups and users
|
||||||
|
```
|
||||||
|
docker-compose build --no-cache --build-arg UID=$(id -u) --build-arg GID=$(id -g) --build-arg UNAME=$(id -un) --build-arg GNAME=$(id -gn) [client | basex]
|
||||||
|
```
|
||||||
### run
|
### run
|
||||||
then each time you want to launch the app
|
then each time you want to launch the app
|
||||||
```
|
```
|
||||||
sudo docker-compose up -d
|
sudo docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
## DB
|
|
||||||
<del>connect http://localhost:8984/synopsx/create-project</del>
|
|
||||||
|
|
||||||
<del>create a 'gdp' project</del>
|
|
||||||
|
|
||||||
<del>connect to http://localhost:8984/synopsx/config</del>
|
|
||||||
<del>select 'gpd' and click on 'ok'</del>
|
|
||||||
|
|
||||||
## API
|
## API
|
||||||
the api is ready, you can go to http://localhost:8984/gdp/home
|
the api is ready, you can go to http://localhost:8984/home
|
||||||
|
|
||||||
|
### indexing
|
||||||
|
before you can use the client you need to trigger this url http://localhost:8984/indexing
|
||||||
|
|
||||||
## Client
|
## Client
|
||||||
open http://localhost:8988 in your browser
|
open http://localhost:8998 in your browser
|
||||||
|
|
||||||
|
## Vhost or Cross Origins Policy
|
||||||
|
Cross origin poilicy will block the api requests from client
|
||||||
|
|
||||||
|
You'll need to install vhost domain for api and client, like dev.gdp.net and dev.api.gdp.net
|
||||||
|
|
||||||
|
Or in firefox install this addon to allow cors addons.mozilla.org/en-US/firefox/addon/cors-everywhere/
|
||||||
|
|
||||||
|
## Logs
|
||||||
to follow the webpack compilation process, run
|
to follow the webpack compilation process, run
|
||||||
```
|
```
|
||||||
sudo docker-compose logs -f
|
sudo docker-compose logs -f
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Update
|
||||||
|
update the code
|
||||||
|
```
|
||||||
|
git pull origin master
|
||||||
|
git pull --recurse-submodules
|
||||||
|
```
|
||||||
|
restart the containers
|
||||||
|
```
|
||||||
|
docker-compose restart basex
|
||||||
|
docker-compose restart client
|
||||||
|
```
|
||||||
|
or rebuild if data was updated
|
||||||
|
```
|
||||||
|
docker-compose up -d --build
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```sh
|
||||||
|
docker-compose build --no-cache [client | basex]
|
||||||
|
docker-compose up -d [client | basex]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Prod
|
||||||
|
run containers for prod
|
||||||
|
```
|
||||||
|
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
|
||||||
|
```
|
||||||
|
client will be built the client container stop
|
||||||
|
|
||||||
|
basex container will stay up
|
||||||
|
|
||||||
|
you have to serve client/dist/index.html with your own webserver (e.g. nginx, apache, etc)
|
||||||
|
|
||||||
|
### nginx conf
|
||||||
|
```nginx
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name dev.api.gdp.fr;
|
||||||
|
|
||||||
|
access_log off;
|
||||||
|
error_log /var/log/nginx/gdp/error.log error;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:8984;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_buffer_size 128k;
|
||||||
|
proxy_buffers 4 256k;
|
||||||
|
proxy_busy_buffers_size 256k;
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name dev.gdp.fr;
|
||||||
|
|
||||||
|
access_log off;
|
||||||
|
error_log /var/log/nginx/gdp/error.log error;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:8998;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_buffer_size 128k;
|
||||||
|
proxy_buffers 4 256k;
|
||||||
|
proxy_busy_buffers_size 256k;
|
||||||
|
add_header Access-Control-Allow-Origin *;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## trouble shooting
|
||||||
|
|
||||||
|
/srv/basex has bad owner : 1000:users instead of basex:basex (1948:1984) (WHY ??)
|
||||||
|
```
|
||||||
|
docker exec -u 0 -it gdp-basex-1 sh
|
||||||
|
chown -R basex:basex /srv/basex
|
||||||
|
```
|
||||||
|
|
||||||
|
gdp-entrypoint is never launched, "launchit by hand" (WHY ??)
|
||||||
|
```
|
||||||
|
docker exec -it gdp-basex-1 sh
|
||||||
|
. /usr/local/bin/gdp-entrypoint.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Doc
|
## Doc
|
||||||
|
|
||||||
https://github.com/guidesDeParis/webapp/blob/master/install.md
|
https://github.com/guidesDeParis/webapp/blob/master/install.md
|
||||||
|
|||||||
+1
-1
Submodule client updated: 01e4d99537...232b44f3c6
+1
-1
Submodule data updated: 423de0caf0...86052c67d5
@@ -0,0 +1,7 @@
|
|||||||
|
version: '3.7'
|
||||||
|
services:
|
||||||
|
basex:
|
||||||
|
restart: always
|
||||||
|
client:
|
||||||
|
environment:
|
||||||
|
- APP_ENV=prod
|
||||||
+7
-3
@@ -6,7 +6,9 @@ services:
|
|||||||
- "${SYNOPSX_ROOT}:/srv/basex/webapp/synopsx"
|
- "${SYNOPSX_ROOT}:/srv/basex/webapp/synopsx"
|
||||||
- "${WEBAPP_ROOT}:/srv/basex/webapp/synopsx/workspace/gdp"
|
- "${WEBAPP_ROOT}:/srv/basex/webapp/synopsx/workspace/gdp"
|
||||||
- "${DATA_ROOT}:/srv/basex/src"
|
- "${DATA_ROOT}:/srv/basex/src"
|
||||||
|
- "${FTINDEX_ROOT}:/srv/basex/ftindex"
|
||||||
- basex-home:/srv
|
- basex-home:/srv
|
||||||
|
# - basex-data:/srv/basex/data
|
||||||
# - "${LOG_ROOT}:/var/log:rw"
|
# - "${LOG_ROOT}:/var/log:rw"
|
||||||
ports:
|
ports:
|
||||||
- 1984:1984
|
- 1984:1984
|
||||||
@@ -17,13 +19,15 @@ services:
|
|||||||
build: ./Docker/client
|
build: ./Docker/client
|
||||||
volumes:
|
volumes:
|
||||||
- "${CLIENT_ROOT}:/app"
|
- "${CLIENT_ROOT}:/app"
|
||||||
# - client-home:/home/gdp
|
- client-home:/home/${USER_UNAME}
|
||||||
ports:
|
ports:
|
||||||
- 8988:8988
|
- 8998:8998
|
||||||
working_dir: "/app"
|
working_dir: "/app"
|
||||||
depends_on:
|
depends_on:
|
||||||
- basex
|
- basex
|
||||||
|
environment:
|
||||||
|
- APP_ENV=dev
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
basex-home:
|
basex-home:
|
||||||
# client-home:
|
client-home:
|
||||||
|
|||||||
Submodule
+1
Submodule gdpFtIndex added at 9fc8e27978
+1
-1
Submodule synopsx updated: 558dd832a2...5185bab9fa
+1
-1
Submodule webapp updated: e6ca72b4a0...220e4d0b21
Reference in New Issue
Block a user