安装curl,git,vim,wget,docker,docker-compose等必备的工具
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| apt update -y
apt install -y wget vim sudo curl git
wget -qO- get.docker.com | bash
docker -v
systemctl enable docker
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
docker-compose --version
|
新建项目文件夹
1 2 3 4 5
| cd ~ 新建umami文件夹 mkdir -p ~/data/docker_data/umami 进去umami文件夹 cd ~/data/docker_data/umami
|
编辑配置文件
写入docker-compose代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| --- version: '3' services: umami: image: docker.umami.dev/umami-software/umami:postgresql-latest ports: - "3000:3000" environment: DATABASE_URL: postgresql://umami:umami@db:5432/umami DATABASE_TYPE: postgresql APP_SECRET: replace-me-with-a-random-string depends_on: - db restart: always db: image: postgres:15-alpine environment: POSTGRES_DB: umami POSTGRES_USER: umami POSTGRES_PASSWORD: umami volumes: - ./sql/schema.postgresql.sql:/docker-entrypoint-initdb.d/schema.postgresql.sql:ro - ./umami-db-data:/var/lib/postgresql/data restart: always
|
检查完毕之后,ctrl+x退出,按y确认修改内容,enter确认
启动Umami
甲骨文的Ubuntu开行3000端口
1 2 3 4 5 6
| iptables -I INPUT -p tcp --dport 2181 -j ACCEPT
iptables-save
netfilter-persistent save netfilter-persistent reload
|