services:
  app:
    image: registry.gitlab.com/dev-initialde/transportdosapi:${IMAGE_TAG}
    ports:
      - "9096:9090"
    environment:
      SPRING_PROFILES_ACTIVE: prod
      SPRING_DATASOURCE_URL: ${POSTGRES_URL}
      SPRING_DATASOURCE_USERNAME: ${POSTGRES_USERNAME}
      SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
      # CORS Configuration - À PERSONNALISER avec vos domaines de production
      # Exemple: CORS_ALLOWED_ORIGINS: "https://api.votre-domaine.com,https://app.votre-domaine.com"
      CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-https://localhost:9090}
    depends_on:
      - postgres
    networks:
      - transport-document-net
    volumes:
      - uploads_data:/var/app/uploads
    restart: always
    env_file:
      - .env

  postgres:
    image: postgres:15
    container_name: transport-document-postgres
    environment:
      POSTGRES_DB: transportDocument
      POSTGRES_USER: initial_user
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - postgres_data:/var/lib/postgresql/data
    networks:
      - transport-document-net
    restart: always

volumes:
  postgres_data:
  uploads_data:

networks:
  transport-document-net:
    driver: bridge
