diff --git a/Docker/basex/Dockerfile b/Docker/basex/Dockerfile index 5b8bf94..2b98642 100644 --- a/Docker/basex/Dockerfile +++ b/Docker/basex/Dockerfile @@ -5,8 +5,6 @@ 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()})" - - COPY ./gdp-entrypoint.sh /usr/local/bin USER root RUN chmod +x /usr/local/bin/gdp-entrypoint.sh diff --git a/Docker/client/Dockerfile b/Docker/client/Dockerfile new file mode 100644 index 0000000..95f7ecd --- /dev/null +++ b/Docker/client/Dockerfile @@ -0,0 +1,24 @@ +FROM node:lts-alpine + +RUN apk update && apk --no-cache add shadow && \ + usermod -u 1001 node && \ + groupmod -g 1001 node + +RUN find / -group 1000 -exec chgrp -h node {} \; +RUN find / -user 1000 -exec chown -h node {} \; + +# RUN addgroup -g 1000 gdp && \ + # adduser -h /home/gdp -D -u 1000 gdp && \ +RUN adduser -u 1000 -G users -s /bin/sh -D gdp + # chown -R gdp:gdp /home/gdp + +USER gdp + +COPY ./bashrc /home/gdp/.bashrc +COPY ./inputrc /home/gdp/.inputrc + +COPY ./client-entrypoint.sh /usr/local/bin +USER root +RUN chmod +x /usr/local/bin/client-entrypoint.sh +USER gdp +CMD ["/bin/sh","/usr/local/bin/client-entrypoint.sh"] diff --git a/Docker/nginx/bashrc b/Docker/client/bashrc similarity index 62% rename from Docker/nginx/bashrc rename to Docker/client/bashrc index 74d78f9..c5b03d2 100644 --- a/Docker/nginx/bashrc +++ b/Docker/client/bashrc @@ -1,3 +1,3 @@ -PS1='\e[36m\e[1mNGINX\e[0m:\e[90m\w\e[0m\n$ ' +PS1='\e[36m\e[1mNODE\e[0m:\e[90m\w\e[0m\n$ ' bind '"\e[A": history-search-backward' bind '"\e[B": history-search-forward' diff --git a/Docker/client/client-entrypoint.sh b/Docker/client/client-entrypoint.sh new file mode 100644 index 0000000..9d6f1e8 --- /dev/null +++ b/Docker/client/client-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +cat /etc/passwd|grep 1000 + +echo "Npm install" + +cd /app +npm install + +echo "Run npm dev" +npm run dev diff --git a/Docker/nginx/inputrc b/Docker/client/inputrc similarity index 100% rename from Docker/nginx/inputrc rename to Docker/client/inputrc diff --git a/Docker/nginx/Dockerfile b/Docker/nginx/Dockerfile deleted file mode 100644 index aa3e544..0000000 --- a/Docker/nginx/Dockerfile +++ /dev/null @@ -1,5 +0,0 @@ -FROM nginx:latest - -COPY ./default.conf /etc/nginx/conf.d/default.conf -COPY ./bashrc /root/.bashrc -COPY ./inputrc /root/.inputrc diff --git a/Docker/nginx/default.conf b/Docker/nginx/default.conf deleted file mode 100644 index 65b57e7..0000000 --- a/Docker/nginx/default.conf +++ /dev/null @@ -1,25 +0,0 @@ -server { - listen 80 default_server; - root /var/www/html/dist; - index index.html; - - charset utf-8; - - location / { - try_files $uri $uri/ /index.php?$query_string; - } - - location = /favicon.ico { access_log off; log_not_found off; } - location = /robots.txt { access_log off; log_not_found off; } - - access_log on; - error_log /var/log/nginx/error.log error; - - sendfile off; - - client_max_body_size 100m; - - location ~ /\.ht { - deny all; - } -} diff --git a/docker-compose.yml b/docker-compose.yml index 308c7df..1f8df11 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,27 +2,28 @@ version: '3.7' services: basex: build: ./Docker/basex/ - - ports: - - 1984:1984 - - 8984:8984 volumes: - "${SYNOPSX_ROOT}:/srv/basex/webapp/synopsx" - "${WEBAPP_ROOT}:/srv/basex/webapp/synopsx/workspace/gdp" - "${DATA_ROOT}:/srv/basex/src" - basex-home:/srv # - "${LOG_ROOT}:/var/log:rw" + ports: + - 1984:1984 + - 8984:8984 working_dir: "/srv/basex" - # nginx: - # build: ./Docker/nginx/ - # ports: - # - 8990:80 - # volumes: - # - "${CLIENT_ROOT}:/var/www/html" - # - "${LOG_ROOT}:/var/log:rw" - # working_dir: "/var/www/html/" - # depends_on: - # - basex + client: + build: ./Docker/client + volumes: + - "${CLIENT_ROOT}:/app" + # - client-home:/home/gdp + ports: + - 8988:8080 + working_dir: "/app" + depends_on: + - basex + volumes: basex-home: + # client-home: