Docker Installing

Requirement Environment

  • Docker
  • Modern browser

Install Steps

The flow of installation is based on Centos7.x.

1. Install docker

Docker Installing - 图1Warning

if you have installed docker, you can skip this step.

The following steps are for Centos, please refer to Docker Official Document for other systems.

  1. yum install -y yum-utils
  2. yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
  3. yum install docker-ce docker-compose-plugin
  4. systemctl enable docker
  5. systemctl start docker

2. Create docker-compose.yml

  1. vi docker-compose.yml
  1. version: "3.3"
  2. services:
  3. db:
  4. image: mariadb:10.8.2
  5. container_name: spug-db
  6. restart: always
  7. command: --port 3306 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
  8. volumes:
  9. - /data/spug/mysql:/var/lib/mysql
  10. environment:
  11. - MYSQL_DATABASE=spug
  12. - MYSQL_USER=spug
  13. - MYSQL_PASSWORD=spug.cc
  14. - MYSQL_ROOT_PASSWORD=spug.cc
  15. spug:
  16. image: openspug/spug-service
  17. container_name: spug
  18. privileged: true
  19. restart: always
  20. volumes:
  21. - /data/spug/service:/data/spug
  22. - /data/spug/repos:/data/repos
  23. ports:
  24. # if port 80 is occupied, you can replace it with other ports, such as: - "8000:80"
  25. - "80:80"
  26. environment:
  27. - MYSQL_DATABASE=spug
  28. - MYSQL_USER=spug
  29. - MYSQL_PASSWORD=spug.cc
  30. - MYSQL_HOST=db
  31. - MYSQL_PORT=3306
  32. depends_on:
  33. - db

3. Start container

  1. docker compose up -d

Docker Installing - 图2warning

docker-compose install method is different, you may also need to execute docker-compose up -d

4. Initialization

The following operation will create an administrator account with the user name admin and password spug.dev, you can replace the administrator account/password by yourself.

  1. docker exec spug init_spug admin spug.dev

5. Access test

Enter http://localhost:80 in the browser to access (the default account password is set in step 4).

6. Version upgrade

You can view the current running Spug version in System Management/System Settings/About, you can view the current latest version in Update Log, if you need to upgrade Spug, please refer to Version Upgrade Document.