Browse Source

added remote container, updated main app

Bachir Soussi Chiadmi 1 year ago
parent
commit
f7d699d22d
10 changed files with 60 additions and 1 deletions
  1. 2 0
      .env
  2. 3 0
      .gitmodules
  3. 24 0
      Docker/remote/Dockerfile
  4. 3 0
      Docker/remote/bashrc
  5. 13 0
      Docker/remote/entrypoint.sh
  6. 2 0
      Docker/remote/inputrc
  7. 3 0
      Makefile
  8. 1 1
      app
  9. 8 0
      docker-compose.yml
  10. 1 0
      remote

+ 2 - 0
.env

@@ -1,4 +1,6 @@
 COMPOSE_PROJECT_NAME=offline_timeline
 
+SERVER_ROOT=./server
 APP_ROOT=./app
+REMOTE_ROOT=./remote
 LOG_ROOT=./log

+ 3 - 0
.gitmodules

@@ -1,3 +1,6 @@
 [submodule "app"]
 	path = app
 	url = https://esadhar.net/gogs/bachir/offline-timeline.git
+[submodule "remote"]
+	path = remote
+	url = https://esadhar.net/gogs/bachir/offline-timeline-remote.git

+ 24 - 0
Docker/remote/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 offline
+    # chown -R gdp:gdp /home/gdp
+
+USER offline
+
+COPY ./bashrc /home/offline/.bashrc
+COPY ./inputrc /home/offline/.inputrc
+
+COPY ./entrypoint.sh /usr/local/bin
+USER root
+RUN chmod +x /usr/local/bin/entrypoint.sh
+USER offline
+CMD ["/bin/sh","/usr/local/bin/entrypoint.sh"]

+ 3 - 0
Docker/remote/bashrc

@@ -0,0 +1,3 @@
+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'

+ 13 - 0
Docker/remote/entrypoint.sh

@@ -0,0 +1,13 @@
+#!/bin/sh
+
+cat /etc/passwd|grep 1000
+
+echo "Npm install"
+
+cd /app
+npm install
+
+npm rebuild node-sass
+
+echo "Run npm dev"
+npm run dev

+ 2 - 0
Docker/remote/inputrc

@@ -0,0 +1,2 @@
+set show-all-if-ambiguous on
+set completion-ignore-case on

+ 3 - 0
Makefile

@@ -38,3 +38,6 @@ down:
 
 exec_app:
 		docker exec -it offline_timeline_app_1 sh
+
+exec_remote:
+		docker exec -it offline_timeline_remote_1 sh

+ 1 - 1
app

@@ -1 +1 @@
-Subproject commit 206d3f769b7026c14b79b3a34de44a31b3b5413b
+Subproject commit b3e859a83349a02667b382b7382f6dbcec70c6b2

+ 8 - 0
docker-compose.yml

@@ -8,3 +8,11 @@ services:
     ports:
       - 8988:8988
     working_dir: "/app"
+  remote:
+    build: ./Docker/remote
+    user: ${USER_UID}:${USER_GID}
+    volumes:
+      - "${REMOTE_ROOT}:/app"
+    ports:
+      - 8989:8989
+    working_dir: "/app"

+ 1 - 0
remote

@@ -0,0 +1 @@
+Subproject commit 9a96ac4ea3206fbb12fcd81fa243bc5665e5c80a