Browse Source

drafted vuejs client container

Bachir Soussi Chiadmi 8 months ago
parent
commit
d4150a38ca

+ 0 - 2
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

+ 24 - 0
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"]

+ 1 - 1
Docker/nginx/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'

+ 11 - 0
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

Docker/nginx/inputrc → Docker/client/inputrc


+ 0 - 5
Docker/nginx/Dockerfile

@@ -1,5 +0,0 @@
-FROM nginx:latest
-
-COPY ./default.conf /etc/nginx/conf.d/default.conf
-COPY ./bashrc /root/.bashrc
-COPY ./inputrc /root/.inputrc

+ 0 - 25
Docker/nginx/default.conf

@@ -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;
-    }
-}

+ 15 - 14
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: