jedie / compose-services

Docker compose services

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compose-services

setup bundlewrap/server

prepare this:

~$ sudo apt install python3-pip
~$ pip3 install -U pip --user
~$ pip3 install -U poerty --user
  • create virtualenv: make install
  • copy .env-example to .env and setup values
  • startup a server/node/vm with:
    • SSH access with Public-Key authentication
    • add "nextcloud" into your ~/.ssh/config
    • setup "admin" user with sudo rights, without any password prompts

e.g.: ~/.ssh/config entry for "nextcloud" node:

Host nextcloud
    HostName nextcloud.example.tld
    User admin
    IdentityFile ~/.ssh/id_rsa
    ControlPath ~/.ssh/ssh_multiplexing_%r@%h:%p
    ControlMaster auto
    ControlPersist 10m

Test SSH connection, e.g.:

compose-services$ ssh nextcloud id
uid=1000(admin) gid=1000(admin) groups=1000(admin),27(sudo)

To setup user "admin" on node "nextcloud", e.g.:

compose-services$ ssh root@nextcloud 'bash -s' < scripts/setup_user.sh "admin"

Check if sudo works without password input, e.g.:

compose-services$ ssh nextcloud sudo id
uid=0(root) gid=0(root) groups=0(root)

Check if bundlewrap can connect, too:

compose-services$ make nextcloud-uptime
poetry run bw -a run nextcloud "uptime"
› nextcloud   10:20:55 up 57 min,  0 users,  load average: 0.00, 0.00, 0.00
i ╭───────────┬─────────────┬────────╮
i │ node      │ return code │ time   │
i ├───────────┼─────────────┼────────┤
i │ nextcloud │           0 │ 0.809s │
i ╰───────────┴─────────────┴────────╯

setup nextcloud

Setup server via bundlewrap:

compose-services$ make nextcloud-apply

Maybe after first "apply" a reboot may be needed for changes to take effect. (e.g.: setup docker usergroups)

Update docker images:

compose-services$ make nextcloud-pull
ssh nextcloud 'docker-compose pull'
Pulling nextcloud-postgres ... done
Pulling nextcloud-redis    ... done
Pulling nextcloud          ... done

Start docker containers:

compose-services$ make nextcloud-up
ssh nextcloud 'docker-compose up -d'
Starting nextcloud-postgres ... done
Starting nextcloud-redis    ... done
Starting nextcloud          ... done

After a few seconds Nextcloud is available at http://nextcloud.example.tld from your host system.

To get the default admin password, run this:

compose-services$ make nextcloud-admin-password 
______________________________________________________________________
admin password is:
Foo-Bar-Foo-Bar-99
----------------------------------------------------------------------

Change the password on nextcloud web page!

Stop docker containers:

compose-services$ make nextcloud-stop 
ssh nextcloud 'docker-compose stop'
Stopping nextcloud          ... done
Stopping nextcloud-postgres ... done
Stopping nextcloud-redis    ... done

base setup

~# nano /etc/ssh/sshd_config

Change e.g.:

Port xxxx
PermitRootLogin no
PasswordAuthentication no
~# service ssh restart
~# journalctl -f -u ssh

setup unattended-upgrades

~$ sudo apt install unattended-upgrades
~$ sudo dpkg-reconfigure unattended-upgrades
~$ sudo nano /etc/apt/apt.conf.d/50unattended-upgrades

About

Docker compose services

License:GNU General Public License v3.0


Languages

Language:Python 63.6%Language:Makefile 30.8%Language:Shell 5.6%