version: "3.8"
services:
  silex-builder:
    image : silexlabs/silex
    restart: always
    environment:
      - ENABLE_FTP=true
      - ENABLE_SFTP=true
    logging:
      options:
        max-size: '12m'
        max-file: '5'
      driver: json-file
    volumes:
      - datasilex:/silex
      - datasilexweb:/root
    labels:
      - traefik.enable=true
      - traefik.http.routers.silex.rule=Host(`${URL_SILEX}`)
      - traefik.http.routers.silex.entrypoints=websecure
      - traefik.http.routers.silex.tls=true
      - traefik.http.routers.silex.tls.certresolver=lets-encrypt
      - traefik.http.services.silex.loadbalancer.server.port=${PORT_SILEX}
    networks:
      - traefik-proxy

networks:
  traefik-proxy:
    external:
      name: ${NETWORK_TRAEFIK}
      
volumes:
  datasilex:
    driver: local
    driver_opts:
      type: none
      device: ${VOLUME_SILEX}
      o: bind
  datasilexweb:
    driver: local
    driver_opts:
      type: none
      device: ${VOLUME_SILEX_WEB}
      o: bind
