From 16a058e0fd6391e94d8e9c211f8dd3ce3d8d72b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Denquin?= Date: Mon, 28 Feb 2022 21:43:33 +0100 Subject: [PATCH] Dev configuration (#1) * misc: Add local dev env configuration * add configuration for api * update modules --- api | 2 +- docker-compose.dev.yml | 56 +++++++++++++++++++++++++++++++++++++++--- front | 2 +- 3 files changed, 55 insertions(+), 5 deletions(-) diff --git a/api b/api index a495d86..3a84ff1 160000 --- a/api +++ b/api @@ -1 +1 @@ -Subproject commit a495d868f5f4ca9b6e9fb5c657d2b4b117a97b3b +Subproject commit 3a84ff11c4f856d3faac7054e7774f01c12391b7 diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 965be2f..6e33fcb 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,8 +1,8 @@ version: "3.8" volumes: - app_node_modules: - app_dist: + front_node_modules: + front_dist: postgres_data: redis_data: @@ -30,6 +30,7 @@ services: container_name: lago_db restart: unless-stopped environment: + POSTGRES_DB: ${POSTGRES_DB:-lago} POSTGRES_USER: ${POSTGRES_USER:-lago} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme} PGDATA: /data/postgres @@ -47,4 +48,53 @@ services: volumes: - redis_data:/data ports: - - 6379:6379 \ No newline at end of file + - 6379:6379 + + front: + image: front + container_name: lago_front + stdin_open: true + restart: unless-stopped + build: + context: ./front + dockerfile: $LAGO_PATH/front/Dockerfile.dev + volumes: + - $LAGO_PATH/front:/app + - front_node_modules:/app/node_modules + - front_dist:/app/dist + environment: + - NODE_ENV=development + - API_URL=https://api.lago.dev + - APP_DOMAIN=https://app.lago.dev + - CODEGEN_API=https://api.lago.dev:3000 + labels: + - "traefik.enable=true" + - "traefik.http.routers.app.rule=Host(`app.lago.dev`)" + - "traefik.http.routers.app.entrypoints=web,websecure" + - "traefik.http.routers.app.tls=true" + - "traefik.http.services.app.loadbalancer.server.port=8080" + + api: + image: api + container_name: lago_api + restart: unless-stopped + build: + context: ./api + dockerfile: $LAGO_PATH/api/Dockerfile.dev + volumes: + - $LAGO_PATH/api:/app + environment: + - DATABASE_URL=postgresql://${POSTGRES_USER:-lago}:${POSTGRES_PASSWORD:-changeme}@db:5432/${POSTGRES_DB:-lago} + labels: + - "traefik.enable=true" + - "traefik.http.routers.api_http.rule=Host(`api.lago.dev`)" + - "traefik.http.routers.api_http.entrypoints=web" + - "traefik.http.routers.api_http.service=api_http" + - "traefik.http.services.api_http.loadbalancer.server.port=3000" + - "traefik.http.routers.api.rule=Host(`api.lago.dev`)" + - "traefik.http.routers.api.entrypoints=websecure" + - "traefik.http.routers.api.service=api" + - "traefik.http.routers.api.tls=true" + - "traefik.http.services.api.loadbalancer.server.port=3000" + + \ No newline at end of file diff --git a/front b/front index f8c815e..dfee2df 160000 --- a/front +++ b/front @@ -1 +1 @@ -Subproject commit f8c815e7956b8e6ec35fa4290d3845ab67bd17d8 +Subproject commit dfee2df8b92b759458c2fa971ccdebbc02980191