forked from jparrareig/developOdooLXC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
InstallOdooLXC
executable file
·44 lines (36 loc) · 2.12 KB
/
InstallOdooLXC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
sudo lxc-create -t download -n $1 -- --dist ubuntu --release jammy --arch amd64
sudo lxc-start $1
sudo lxc-info $1
sudo lxc-attach -n $1 -- useradd -m -d /home/odoo -s /bin/bash odoo
# Ask user to enter password
echo "Ingrese la contraseña para el usuario odoo:"
read -s password
# Set the password for the "odoo" user inside the container
echo "odoo:$password" | sudo lxc-attach -n $1 -- chpasswd
sudo lxc-attach -n $1 -- sudo apt-get update
sudo lxc-attach -n $1 -- sudo apt-get -y install postgresql postgresql-client
sudo lxc-attach -n $1 -- su postgres -c "psql -c 'create database odoo'"
sudo lxc-attach -n $1 -- su postgres -c "psql -c 'create user odoo with encrypted password '\''odoo'\''; grant all privileges on database odoo to odoo;'"
sudo lxc-attach -n $1 -- sudo apt-get -y install git
sudo lxc-attach -n $1 -- su odoo -c 'cd /home/odoo; git clone https://github.com/Odoo/odoo.git --depth 1 --branch 16.0 --single-branch odoo'
sudo lxc-attach -n $1 -- sudo apt-get -y install python3-pip libldap2-dev libpq-dev libsasl2-dev
sudo lxc-attach -n $1 -- su odoo -c 'pip install -r /home/odoo/odoo/requirements.txt'
sudo lxc-attach -n $1 -- sudo apt-get install -y software-properties-common
sudo lxc-attach -n $1 -- sudo apt-add-repository -y "deb http://security.ubuntu.com/ubuntu focal-security main"
sudo lxc-attach -n $1 -- sudo apt-get -yq update
sudo lxc-attach -n $1 -- sudo apt-get -y install wget openssh-server
sudo lxc-attach -n $1 -- wget "https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.focal_amd64.deb"
sudo lxc-attach -n $1 -- sudo apt install -y ./wkhtmltox_0.12.5-1.focal_amd64.deb
sudo lxc-attach -n $1 -- su odoo -c "echo '[options]
db_host = 127.0.0.1
db_port = 5432
db_user = odoo
db_password = odoo
default_productivity_apps = False
addons_path =
/home/odoo/odoo/addons,
/home/odoo/odoo/odoo/addons' > /home/odoo/odoo.conf"
sudo lxc-info -n $1 -iH
sudo lxc-attach -n $1 -- su odoo -c '/home/odoo/odoo/odoo-bin -c /home/odoo/odoo.conf -i base --stop-after-init -d odoo'
sudo lxc-attach -n $1 -- su odoo -c '/home/odoo/odoo/odoo-bin -c /home/odoo/odoo.conf -d odoo'