version: "3"

services:
  web-app:
    restart: unless-stopped
    build: .
    image: registry.forge.grandlyon.com/web-et-numerique/web-et-numerique-internet/data.grandlyon.com/web-portal/components/custom-apps/web-app:${TAG}
    volumes: 
      - ./nginx.conf.template:/etc/nginx/nginx.conf.template
    ports: 
      - ${WEB_APP_BIND_PORT}:8080
    command: >
      /bin/sh -c
      'sed "s#<MATOMO_SITE_ID>#$MATOMO_SITE_ID#g; s#<MATOMO_SERVER_URL>#$MATOMO_SERVER_URL#g" /etc/nginx/nginx.conf.template
      > /etc/nginx/conf.d/default.conf
      && nginx -g "daemon off;"'
  
