tgvmax-bot icon indicating copy to clipboard operation
tgvmax-bot copied to clipboard

feat/docker-compose

Open franckdrion opened this issue 2 years ago • 0 comments

docker-compose fonctionnel à condition d'effectuer une modification sur le fichier prod.env.js, j'imagine que c'est perfectible mais fonctionnel tel quel. L'intérêt est principalement de se décharger de l'installation du reverse proxy sur la machine local (DOCKER_HOST) via l'utilisation d'une image nginx un peu tweaké pour gérer son fichier de conf de manière autonome.

# editer le fichier frontend/config/prod.env.js :   API_URL: '"http://tgvmax-backend:8080/api"' (possible via une var d'env API_URL?)
# lancer la stack avec la commande : docker-compose up -d --build
# editer son fichier host afin d'y ajouter les entrées suivantes : 127.0.0.1 tgvmax-frontend et 127.0.0.1 tgvmax-backend
# se rendre sur http://tgvmax-frontend

version: "3"

services:
  nginx:
    image: jwilder/nginx-proxy
    ports:
      - "80:80"
    volumes:
      - /var/run/docker.sock:/tmp/docker.sock:ro
    restart: always

  tgvmax-frontend:
    image: tgvmax-frontend
    build: ./frontend
    container_name: tgvmax-frontend
    environment:
      - VIRTUAL_HOST=tgvmax-frontend
    restart: always

  tgvmax-backend:
    image: tgvmax-backend
    build: ./backend
    container_name: tgvmax-backend
    environment:
      - VIRTUAL_HOST=tgvmax-backend
    ports:
      - "8080:8080"
    restart: on-failure

franckdrion avatar Jan 25 '23 21:01 franckdrion