Browse Source

Add Makefile and docker Frames_v3

Maha Bouchiba 2 years ago
parent
commit
1bcd319286
6 changed files with 65 additions and 1 deletions
  1. 4 0
      .env.skeleton
  2. 1 0
      .gitignore
  3. 20 0
      Makefile.skeleton
  4. 24 1
      docker-compose.yml
  5. 1 0
      docker/frames_v3/.gitignore
  6. 15 0
      docker/frames_v3/Dockerfile

+ 4 - 0
.env.skeleton

@@ -39,6 +39,10 @@ FRAMES_VIRTUAL_HOST=local.frames.opentalent.fr
 FRAMES_PORT=3004
 FRAMES_REPORT_PORT=3005
 
+#FRAMES_V3
+FRAMES_V3_VIRTUAL_HOST=local.frames_v3.opentalent.fr
+FRAMES_V3_PORT=3000
+
 #V59
 V59_VIRTUAL_HOST=local.v59.opentalent.fr
 

+ 1 - 0
.gitignore

@@ -20,3 +20,4 @@
 .DS_Store
 docker-compose-dev.yml
 docker-sync.yml
+Makefile

+ 20 - 0
Makefile.skeleton

@@ -0,0 +1,20 @@
+# Ce Makefile permet de lancer les containers docker et les applications frames
+# et frames_v3 en même temps (véirfier que le port 3019 est libre)
+.PHONY: all launch_containers frames frames_v3 db_watch
+
+launch: launch_containers frames frames_v3 db_watch  
+
+launch_containers:
+	docker-compose up -d
+
+frames:
+	docker exec -d frames bash -c "yarn dev"
+
+frames_v3:
+	docker exec -d frames_v3 bash -c "yarn dev"
+
+db_watch:
+	cd apps/frames_v3 && json-server db.json --watch --port 3019 
+
+# frames_v3 : https://local.frames_v3.opentalent.fr
+# frames : https://local.frames.opentalent.fr/

+ 24 - 1
docker-compose.yml

@@ -220,7 +220,7 @@ services:
       - ./apps/app-v3:/home/workspace:rw,cached
     tty: true
     ports:
-      - 3006:3000
+      - 3009:3000
       - 24678:24678
     environment:
       - VIRTUAL_HOST=${APP_V3_VIRTUAL_HOST}
@@ -256,6 +256,29 @@ services:
     depends_on:
       - nginx_new
 
+  frames_v3:
+    hostname: frames_v3
+    container_name: frames_v3
+    build:
+      context: .
+      dockerfile: docker/frames_v3/Dockerfile
+    volumes:
+      - ./apps/frames_v3:/home/workspace:rw,cached
+    tty: true
+    ports:
+      - 3007:3000
+      - 24679:24679
+    environment:
+      - VIRTUAL_HOST=${FRAMES_V3_VIRTUAL_HOST}
+      - VIRTUAL_PORT=${FRAMES_V3_PORT}
+      - NODE_ENV=development
+      - HTTPS_METHOD=noredirect
+    networks:
+      network:
+        ipv4_address: 172.20.2.5
+    depends_on:
+      - nginx_new
+
   portail:
     hostname: portail
     container_name: portail

+ 1 - 0
docker/frames_v3/.gitignore

@@ -0,0 +1 @@
+/.idea/

+ 15 - 0
docker/frames_v3/Dockerfile

@@ -0,0 +1,15 @@
+    # Pull base image.
+FROM node:18.10-buster
+
+ENV WORKDIR /home/workspace
+
+RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
+    echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
+
+
+RUN apt-get update && apt-get install -y g++ build-essential yarn
+
+# Define working directory.
+WORKDIR ${WORKDIR}
+
+CMD node