blabla1337 / skf-flask

Security Knowledge Framework (SKF) Python Flask / Angular project
https://www.securityknowledgeframework.org
Apache License 2.0
805 stars 308 forks source link

Docker-compose for LAN #725

Closed telekomancer closed 2 years ago

telekomancer commented 3 years ago

I assume that the person that wants to use docker-compose.yml to expose to LAN users have the IP 192.168.1.2 so please correct according to your real IP Address.

I attach an example of docker-compose.yml fully functional:

# Run docker-compose up
# Live long and prosper
version: '2'
services:
  rabbitmq:
    container_name: skf-rabbitmq_container
    image: rabbitmq:latest
    environment:
        - RABBITMQ_DEFAULT_USER=admin
        - RABBITMQ_DEFAULT_PASS=admin-skf-secret
    ports:
        - "5672:5672"
        - "15672:15672"

  mysql:
    container_name: skf-mysql_container
    image: blabla1337/mysql
    restart: always
    environment:
      MYSQL_DATABASE: 'skf'
      MYSQL_ROOT_PASSWORD: 'admin-skf-secret'
      MYSQL_DEFAULT_PASS: 'admin-skf-secret'
      MYSQL_DEFAULT_USER: 'root'
    ports:
      - '3306:3306'

  nginx:
    container_name: skf-nginx_container
    restart: always
    image: nginx
    volumes:
      - ./Docker/compose/site.conf:/etc/nginx/nginx.conf
    ports:
      - "82:80"

  skf-angular:
    container_name: skf-angular_container
    depends_on:
      - "rabbitmq"
      - "nginx"
      - "mysql"
    restart: always
    image: "blabla1337/skf-angular:4.0.0"
    environment:
      - FRONTEND_URI=http://192.168.1.2/
      # DO skip login:
      - SKIP_LOGIN=skiploginprovider
      # DO NOT skip login:
      #- SKIP_LOGIN=skflogin

  skf-api:
    container_name: skf-api_container
    depends_on:
      - "rabbitmq"
      - "nginx"
      - "mysql"
    restart: always
    volumes:
      - ~/.kube/config:/home/user_api/.kube/config
    image: "blabla1337/skf-api:4.0.0"
    environment:
      - SKF_FLASK_DEBUG=False
      - SKF_API_URL=http://192.168.1.2/api
      - SKF_TESTING=False
      - SKF_DB_URL=mysql+pymysql://root:admin-skf-secret@mysql/skf?charset=utf8mb4
      - SKF_JWT_SECRET=please_change_this_value_to_be_random
      - SKF_LABS_DOMAIN=http://localhost
      - RABBIT_MQ_CONN_STRING=rabbitmq
      - LABS_KUBE_CONF=~/.kube/config
      #- JWT_ENABLED="False"
      #- SKF_DOJO_API_KEY=

This can be added as example of config.

And you can access from (for example) for 192.168.1.3.

This doesn't consider the labs (labs need kubernetes and localhost setted).

Kind regards!

blabla1337 commented 2 years ago

Indeed, thanks for this. will close ticket and will be stored for help for other users