services:
    web:
#      image: timonepac872/timcash-backend
      build: ./config/
#      command: python /app/main.py
      restart: always
      depends_on:
        - database
      volumes:
        - ./config/.env:/app/.env
      ports:
        - '81:8000'
      networks:
        - teamcash_net

    database:
#        image: timonepac872/timcash-backend:mysql-latest
        image: mysql:8.0
        restart: always
#        extra_hosts:
#            - "dockerhost:172.17.0.1"
        volumes:
             - ./data:/var/lib/mysql
        environment:
            - MYSQL_ROOT_PASSWORD  # password root
            - MYSQL_DATABASE
            - MYSQL_USER
            - MYSQL_PASSWORD
#        ports:
#            - '3308:3306'
        networks:
            - teamcash_net

#    redis:
#        container_name: redis
#        image: redis:7
#        command: redis-server --appendonly yes
#        ports:
#            - "6379:6379"
#        networks:
#            - teamcash_net

networks:
  teamcash_net:
   # Use a custom driver
   driver: bridge
   ipam:
    config:
     - subnet: 193.0.1.32/29
       gateway: 193.0.1.36
