Installazione di Guacamole con Docker: Difference between revisions

From RVM Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
== Con DB MySQL / MariaDB ==
<pre>
cat > docker-compose.yml <<'EOFile'
services:
  guacamole-frontend:
    image: guacamole/guacamole:latest
    container_name: guacamole-frontend
    depends_on:
    - guacamole-guacd
    - guacamole-db
    environment:
      - GUACD_HOSTNAME=guacamole-guacd
      - MYSQL_HOSTNAME=guacamole-db
      - MYSQL_DATABASE=guacamole_db
      - MYSQL_USER=guacamole_user
      - MYSQL_PASSWORD=guacamole_pass
      - WEBAPP_CONTEXT=ROOT
      - UID=1001
      - GID=1001
      # Put additional extension here directly in extensions/
      # for esxample, for Branding the login screen:
      # https://github.com/Zer0CoolX/guacamole-customize-loginscreen-extension
      # Downliad, edit files on the jar/zip file and upload
      - GUACAMOLE_HOME=/guacamole_home
      # mkdir guacamole_home/; chown 1001:1001 guacamole_home/
      # These extensions are builtin in the image, and activated by this var
      #- EXTENSIONS="auth-ldap,auth-totp,history-recording-storage"
    volumes:
    - ./drive:/drive:rw
    - ./guacamole_home:/guacamole_home
    ports:
      - 8080:8080/tcp
    restart: unless-stopped
  guacamole-guacd:
    image: guacamole/guacd:latest
    container_name: guacamole-guacd
    restart: unless-stopped
    volumes:
    - ./drive:/drive:rw
    - ./record:/record:rw
  guacamole-db:
    image: mariadb:11.2-jammy
    container_name: guacamole-db
    environment:
    - MYSQL_ROOT_PASSWORD=root
    - MYSQL_DATABASE=guacamole_db
    - MYSQL_USER=guacamole_user
    - MYSQL_PASSWORD=guacamole_pass
    restart: unless-stopped
    volumes:
    - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro
    - ./mysql:/var/lib/mysql
    #- ./mysql-init.sql:/tmp/mysql-init.sql
EOFile
</pre>
== Con DB Postgres ==
* Creare docker-compose.yml
* Creare docker-compose.yml



Revision as of 09:20, 4 July 2024

Con DB MySQL / MariaDB

cat > docker-compose.yml <<'EOFile'
services:

  guacamole-frontend:
    image: guacamole/guacamole:latest
    container_name: guacamole-frontend
    depends_on:
     - guacamole-guacd
     - guacamole-db
    environment:
      - GUACD_HOSTNAME=guacamole-guacd
      - MYSQL_HOSTNAME=guacamole-db
      - MYSQL_DATABASE=guacamole_db
      - MYSQL_USER=guacamole_user
      - MYSQL_PASSWORD=guacamole_pass
      - WEBAPP_CONTEXT=ROOT
      - UID=1001
      - GID=1001
      # Put additional extension here directly in extensions/
      # for esxample, for Branding the login screen:
      # https://github.com/Zer0CoolX/guacamole-customize-loginscreen-extension
      # Downliad, edit files on the jar/zip file and upload
      - GUACAMOLE_HOME=/guacamole_home
      # mkdir guacamole_home/; chown 1001:1001 guacamole_home/
      # These extensions are builtin in the image, and activated by this var
      #- EXTENSIONS="auth-ldap,auth-totp,history-recording-storage"
    volumes:
     - ./drive:/drive:rw
     - ./guacamole_home:/guacamole_home
    ports:
      - 8080:8080/tcp
    restart: unless-stopped
  guacamole-guacd:
    image: guacamole/guacd:latest
    container_name: guacamole-guacd
    restart: unless-stopped
    volumes:
     - ./drive:/drive:rw
     - ./record:/record:rw

  guacamole-db:
    image: mariadb:11.2-jammy
    container_name: guacamole-db
    environment:
     - MYSQL_ROOT_PASSWORD=root
     - MYSQL_DATABASE=guacamole_db
     - MYSQL_USER=guacamole_user
     - MYSQL_PASSWORD=guacamole_pass
    restart: unless-stopped
    volumes:
     - ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro
     - ./mysql:/var/lib/mysql
     #- ./mysql-init.sql:/tmp/mysql-init.sql
EOFile

Con DB Postgres

  • Creare docker-compose.yml
cat > docker-compose.yml <<EOFile
version: '3.9'

# services
services:
  # guacd
  guacd:
    container_name: guacamole_backend
    image: guacamole/guacd:latest
    restart: always
    volumes:
    - ./drive:/drive:rw
    - ./record:/record:rw

  # postgres
  postgres:
    container_name: guacamole_database
    environment:
      PGDATA: /var/lib/postgresql/data/guacamole
      POSTGRES_DB: guacamole_db
      POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
      POSTGRES_USER: '${POSTGRES_USER}'
    image: postgres:13.4
    restart: always
    volumes:
    - ./init:/docker-entrypoint-initdb.d:ro
    - ./data:/var/lib/postgresql/data:rw
    
  # guacamole
  guacamole:
    container_name: guacamole_frontend
    depends_on:
    - guacd
    - postgres
    environment:
      GUACD_HOSTNAME: guacd
      POSTGRES_DATABASE: guacamole_db
      POSTGRES_HOSTNAME: postgres
      POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
      POSTGRES_USER: '${POSTGRES_USER}'
      POSTGRESQL_AUTO_CREATE_ACCOUNTS: true
      WEBAPP_CONTEXT=ROOT # to access as /
      WEBAPP_CONTEXT=remote # to access as /remote

    image: guacamole/guacamole:latest
    ports:
      - 8888:8080/tcp
    links:
    - guacd
    restart: always
    volumes:
    - ./drive:/drive:rw
EOFile
  • Creare il file contente a password di postgres:
cat > .env <<EOFile
POSTGRES_PASSWORD='PleasePutAStrongPasswordHere'
POSTGRES_USER='guacamole_user'
EOFile
  • Creare il file di inizializzazione del DB
mkdir init
docker run --rm guacamole/guacamole /opt/guacamole/bin/initdb.sh --postgres > init/initdb.sql
  • Lanciare
docker compose up
guacadmin
guacadmin
  • Per cambiare la password, andare su Opzioni/Preferenze

Riferimenti