Compare commits
48
Commits
nginx-proxy
..
debug
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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,6 +4,14 @@
|
|||||||
|
|
||||||
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', '/tmp/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'
|
||||||
|
|
||||||
# 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"
|
||||||
|
|||||||
@@ -4,21 +4,26 @@ 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 {} \;
|
ARG UID=1000
|
||||||
RUN find / -user 1000 -exec chown -h node {} \;
|
ARG UNAME=gdp
|
||||||
|
ARG GID=1000
|
||||||
|
ARG GNAME=users
|
||||||
|
|
||||||
# RUN addgroup -g 1000 gdp && \
|
#RUN find / -group ${UID} -exec chgrp -h node {} \;
|
||||||
|
#RUN find / -user ${UID} -exec chown -h node {} \;
|
||||||
|
|
||||||
|
RUN addgroup -g ${DID} ${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 ${UID} -G ${GNAME} -s /bin/sh -D ${UNAME}
|
||||||
# chown -R gdp:gdp /home/gdp
|
# chown -R gdp:gdp /home/gdp
|
||||||
|
|
||||||
USER gdp
|
USER ${UNAME}
|
||||||
|
|
||||||
COPY ./bashrc /home/gdp/.bashrc
|
COPY ./bashrc /home/${UNAME}/.bashrc
|
||||||
COPY ./inputrc /home/gdp/.inputrc
|
COPY ./inputrc /home/${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 ${UNAME}
|
||||||
CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]
|
CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"]
|
||||||
|
|||||||
@@ -2,9 +2,12 @@
|
|||||||
|
|
||||||
cat /etc/passwd|grep 1000
|
cat /etc/passwd|grep 1000
|
||||||
|
|
||||||
echo "Npm install"
|
|
||||||
|
|
||||||
cd /app
|
cd /app
|
||||||
|
|
||||||
|
echo "Cleaning node_modules"
|
||||||
|
rm -rf node_modules
|
||||||
|
|
||||||
|
echo "Npm install"
|
||||||
npm install
|
npm install
|
||||||
|
|
||||||
echo "Run npm dev"
|
echo "Run npm dev"
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
FROM nginx:latest
|
|
||||||
|
|
||||||
COPY ./bashrc /root/.bashrc
|
|
||||||
COPY ./inputrc /root/.inputrc
|
|
||||||
COPY ./index.html /var/www/html/index.html
|
|
||||||
# COPY ./default.conf /etc/nginx/conf.d/default.conf
|
|
||||||
COPY ./default.conf /etc/nginx/nginx.conf
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
PS1='\e[36m\e[1mNGINX\e[0m:\e[90m\w\e[0m\n$ '
|
|
||||||
bind '"\e[A": history-search-backward'
|
|
||||||
bind '"\e[B": history-search-forward'
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
worker_processes 1;
|
|
||||||
|
|
||||||
events { worker_connections 1024; }
|
|
||||||
|
|
||||||
http {
|
|
||||||
upstream docker-api {
|
|
||||||
server basex:8984;
|
|
||||||
}
|
|
||||||
upstream docker-client {
|
|
||||||
server client:8988;
|
|
||||||
}
|
|
||||||
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-NginX-Proxy true;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
proxy_set_header X-Forwarded-Host $server_name;
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 80;
|
|
||||||
root /var/www/html;
|
|
||||||
index index.html;
|
|
||||||
charset utf-8;
|
|
||||||
server_name dev.gdp.fr;
|
|
||||||
|
|
||||||
access_log on;
|
|
||||||
error_log /var/log/nginx/error.log error;
|
|
||||||
|
|
||||||
sendfile off;
|
|
||||||
|
|
||||||
client_max_body_size 100m;
|
|
||||||
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ index.html;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /api {
|
|
||||||
rewrite ^/api/(.*) /$1 break;
|
|
||||||
proxy_redirect off;
|
|
||||||
proxy_pass http://docker-api;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /client {
|
|
||||||
rewrite ^/client/(.*) /$1 break;
|
|
||||||
proxy_redirect off;
|
|
||||||
proxy_pass http://docker-client;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en" dir="ltr">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Proxy</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<ul>
|
|
||||||
<li><a href="/api">api</a></li>
|
|
||||||
<li><a href="/client">client</a></li>
|
|
||||||
</ul>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
set show-all-if-ambiguous on
|
|
||||||
set completion-ignore-case on
|
|
||||||
@@ -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,52 @@ 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 --build-arg UID=$(id -u) --build-arg GID=$(id -g) --build-arg UNAME=$(id -un) --build-arg GNAME=$(id -gn)
|
||||||
|
```
|
||||||
### 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:8988 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
|
||||||
|
```
|
||||||
|
|
||||||
## 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...14beb796ea
+1
-1
Submodule data updated: 423de0caf0...beee67faae
@@ -12,8 +12,6 @@ services:
|
|||||||
- 1984:1984
|
- 1984:1984
|
||||||
- 8984:8984
|
- 8984:8984
|
||||||
working_dir: "/srv/basex"
|
working_dir: "/srv/basex"
|
||||||
networks:
|
|
||||||
- api
|
|
||||||
|
|
||||||
client:
|
client:
|
||||||
build: ./Docker/client
|
build: ./Docker/client
|
||||||
@@ -25,28 +23,7 @@ services:
|
|||||||
working_dir: "/app"
|
working_dir: "/app"
|
||||||
depends_on:
|
depends_on:
|
||||||
- basex
|
- basex
|
||||||
networks:
|
|
||||||
- client
|
|
||||||
|
|
||||||
nginx:
|
|
||||||
build: ./Docker/nginx/
|
|
||||||
ports:
|
|
||||||
- 8999:80
|
|
||||||
volumes:
|
|
||||||
- "${LOG_ROOT}:/var/log:rw"
|
|
||||||
# working_dir: "/var/www/html"
|
|
||||||
depends_on:
|
|
||||||
- basex
|
|
||||||
- client
|
|
||||||
networks:
|
|
||||||
- api
|
|
||||||
- client
|
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
basex-home:
|
basex-home:
|
||||||
# client-home:
|
# client-home:
|
||||||
|
|
||||||
networks:
|
|
||||||
api:
|
|
||||||
client:
|
|
||||||
|
|||||||
+1
-1
Submodule synopsx updated: 558dd832a2...c84136501e
+1
-1
Submodule webapp updated: e6ca72b4a0...34356e0fc7
Reference in New Issue
Block a user