Browse Source

starting point of docker vue app (not working: npm wont install)

Bachir Soussi Chiadmi 1 year ago
parent
commit
edff8f413c
9 changed files with 54 additions and 1 deletions
  1. 4 0
      .env
  2. 24 0
      Docker/app/Dockerfile
  3. 3 0
      Docker/app/bashrc
  4. 11 0
      Docker/app/entrypoint.sh
  5. 2 0
      Docker/app/inputrc
  6. 1 1
      app
  7. 9 0
      docker-compose.yml
  8. 0 0
      log/nginx/.gitkeep
  9. BIN
      static/img/logo.png

+ 4 - 0
.env

@@ -0,0 +1,4 @@
+COMPOSE_PROJECT_NAME=offline_timeline
+
+APP_ROOT=./app
+LOG_ROOT=./log

+ 24 - 0
Docker/app/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/app/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'

+ 11 - 0
Docker/app/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

+ 2 - 0
Docker/app/inputrc

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

+ 1 - 1
app

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

+ 9 - 0
docker-compose.yml

@@ -0,0 +1,9 @@
+version: '3.7'
+services:
+  app:
+    build: ./Docker/app
+    volumes:
+      - "${APP_ROOT}:/app"
+    ports:
+      - 8988:8988
+    working_dir: "/app"

+ 0 - 0
log/nginx/.gitkeep


BIN
static/img/logo.png