本文共 719 字,大约阅读时间需要 2 分钟。
创建文件夹
mkidr -p gogscd gogs
docker-compose.yaml的改写
gogs: image: docker.io/gogs/gogs:latest links: - mysql-gogs:mysql ports: - "10022:22" - "3000:3000" volumes: - /opt/docker/gogs/:/data/docker/gogs restart: alwaysmysql-gogs: image: docker.io/mysql:8.0 ports: - "3306:3306" volumes: - ./mysql-gogs/mysql:/var/lib/mysql - ./mysql-gogs/conf.d:/etc/mysql/conf.d:rw environment: - MYSQL_DATABASE=gogs - MYSQL_USER=gogs - MYSQL_PASSWORD=gogs - MYSQL_ROOT_PASSWORD=root command: mysqld --lower_case_table_names=1 --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci restart: always
访问http://服务器ip:3000
注意数据库用户改成gogs转载地址:http://ahlqj.baihongyu.com/