Home > Development Tools > git > How to use Docker to deploy Gitee College Edition

How to use Docker to deploy Gitee College Edition

PHPz
Release: 2023-03-31 11:20:34
Original
1008 people have browsed it

As open source becomes more and more popular, more and more small and medium-sized enterprises, individuals and universities are beginning to choose to use Gitee to manage their projects. In order to better meet the needs of university users, Gitee has also launched Gitee University Edition. So, how to deploy Gitee College Edition? Next, this article will introduce how to use Docker to deploy Gitee College Edition in a Linux environment.

1. Preparation work

1. Install Docker and Docker-Compose tools

First install Docker and Docker-Compose tools, Docker-Compose is used to establish between containers Contacts and dependencies allow containers to communicate with each other. After installing Docker, you can install Docker-Compose through the following command:

sudo apt-get install docker-compose
Copy after login

2. Configure Gitee University Edition

After installing Docker and Docker-Compose tools, you need to create and configure Gitee University Edition related configuration files. Save the following content to a file named gitee.env:

## Gitee setting
PRIVATE_TOKEN=此处填入你的私人令牌
CUSTOM_URL=此处填入你的域名(如果有)
ENABLE_LDAP=false #设置为true启用LDAP服务
LDAP_SERVER=ldap://localhost:389 #LDAP服务地址
LDAP_UID=admin #LDAPbinddn用户名
LDAP_PWD=admin #LDAPbinddn密码
LDAP_SEARCH_DN='cn=xxx,dc=xxx,dc=xxx' #修改为相应的LDAP_SEARCH_DN
LDAP_ATTRS=['uidNumber','gidNumber','homeDirectory'] #根据需要更改LDAP_ATTRS
EXTERNAL_URL=http://localhost #修改为相应的地址
Copy after login

2. Create a data volume

1. Create the data volume required for Gitee College Edition

docker volume create gitee-data
docker volume create gitee-db
docker volume create gitee-redis
Copy after login

2 .Set the access permissions of the data volume

sudo chmod -R 777 /var/lib/docker/volumes/gitee-data
sudo chmod -R 777 /var/lib/docker/volumes/gitee-db
sudo chmod -R 777 /var/lib/docker/volumes/gitee-redis
Copy after login

3. Start Gitee College Edition

1. Create the docker-compose.yml file

Create docker- in the root directory of the project compose.yml file, save the following content to the file:

version : '2'

services:
  gitee:
    image: giteegroup/gitee-ce:11.0.3-20200528205614
    restart: always
    volumes:
      - gitee-data:/data/gitee/data
      - gitee-redis:/data/gitee/redis
      - gitee-db:/data/gitee/mysql
    environment:
      - CUSTOM_URL=$CUSTOM_URL
      - PRIVATE_TOKEN=$PRIVATE_TOKEN
      - EXTERNAL_URL=$EXTERNAL_URL
      - ENABLE_LDAP=$ENABLE_LDAP
      - LDAP_SERVER=$LDAP_SERVER
      - LDAP_UID=$LDAP_UID
      - LDAP_PWD=$LDAP_PWD
      - LDAP_SEARCH_DN=$LDAP_SEARCH_DN
      - LDAP_ATTRS=$LDAP_ATTRS
    ports:
      - '10022:22'
      - '80:80'
      - '443:443'
    networks:
      - gitee-net

networks:
  gitee-net:

volumes:
  gitee-data:
  gitee-db:
  gitee-redis:
Copy after login

2. Run docker-compose

docker-compose -f docker-compose.yml up -d
Copy after login

3. Wait for Gitee College Edition to start up

Finally, wait Gitee University Edition has been started. Access your domain name to enter the management page of Gitee University Edition.

Summary

Through the above steps, we can use Docker to deploy Gitee College Edition in a Linux environment and manage our projects conveniently. At the same time, Gitee College Edition also provides LDAP services, allowing college users to use their own accounts to log in and authenticate. I hope the above content can help everyone, thank you for reading!

The above is the detailed content of How to use Docker to deploy Gitee College Edition. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template