These are some guides for various use.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
4.2 KiB

7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
  1. # Gitea
  2. Gitea is a selfhostable git server with a web interface.
  3. It is similar to Github but opensource.
  4. ## Client
  5. If you want to use all features in addition to the basic client described in
  6. [git.md](git.md) but don't want to use the web-interface all the time you can get
  7. [tea](https://gitea.com/gitea/tea) the official cli-tool for gitea.
  8. ## Setup Server
  9. ### Docker
  10. #### Gitea
  11. ##### Environment-variables
  12. Set the following environment-variables in the `environment:` section of the
  13. docker-compose file.
  14. | Name | Usage | Default |
  15. | ----------- | ------------------------------ | ------- |
  16. | `USER_UID` | User userid to run gitea | |
  17. | `USER_GID` | User groupid to run gitea | |
  18. | `DB_TYPE` | Specify database type | |
  19. | `DB_HOST` | Specify database host and port | |
  20. | `DB_NAME` | Specify Name of the database | |
  21. | `DB_USER` | Username for the database | |
  22. | `DB_PASSWD` | Password for the database | |
  23. ##### Volumes
  24. Set the following volumes in the `volumes:` section of the docker-compose file.
  25. | Volume-Name | Container mount | Description |
  26. | ---------------- | ------------------ | ------------------------------ |
  27. | `data` | `/data` | storage for data of git server |
  28. | `/etc/timezone` | `/etc/timezone:ro` | link timezone |
  29. | `/etc/localtime` | `/etc/localtime` | link localtime |
  30. ##### Ports
  31. Set the following ports in the `ports:` section.
  32. | Container Port | Recommended outside port | Protocol | Description |
  33. | -------------- | ------------------------ | -------- | ---------------------- |
  34. | `3000` | `3000` | TCP | WebUI |
  35. | `22` | `222` | TCP | ssh port of git server |
  36. ##### Networks
  37. Set the following networks in the `networks:` section of the docker-compose file.
  38. | Name | Usage |
  39. | ------- | --------------------- |
  40. | `gitea` | connect db with gitea |
  41. ##### Dependencies
  42. Set the following dependencies in the `depends_on:` section of the
  43. docker-compose file.
  44. | Name | Usage |
  45. | ---- | -------------------- |
  46. | `db` | Ensure db is running |
  47. #### MySql
  48. ##### Environment-variables
  49. Set the following environment-variables in the `environment:` section of the
  50. docker-compose file.
  51. | Name | Usage | Default |
  52. | --------------------- | ----------------------------- | ------- |
  53. | `MYSQL_ROOT_PASSWORD` | set the mysql admin password | |
  54. | `MYSQL_USER` | set the mysql username | |
  55. | `MYSQL_PASSWORD` | set the mysql user password | |
  56. | `MYSQL_Database` | specify mysql database to use | |
  57. ##### Volumes
  58. Set the following volumes in the `volumes:` section of the docker-compose file.
  59. | Volume-Name | Container mount | Description |
  60. | ----------- | ---------------- | ------------------------- |
  61. | `mysql` | `/var/lib/mysql` | storage for owncloud data |
  62. ##### Networks
  63. Set the following networks in the `networks:` section of the docker-compose file.
  64. | Name | Usage |
  65. | ------- | --------------------- |
  66. | `gitea` | connect db with gitea |
  67. #### Rebuild
  68. ```shell
  69. #!/bin/sh
  70. docker-compose down
  71. docker-compose up -d
  72. ```
  73. #### Docker-Compose.yml
  74. ```yml
  75. version: "2"
  76. networks:
  77. gitea:
  78. external: false
  79. services:
  80. server:
  81. image: gitea/gitea:latest
  82. environment:
  83. - USER_UID=1000
  84. - USER_GID=1000
  85. - DB_TYPE=mysql
  86. - DB_HOST=db:3306
  87. - DB_NAME=gitea
  88. - DB_USER=gitea
  89. - DB_PASSWD=gitea
  90. restart: unless-stopped
  91. networks:
  92. - gitea
  93. volumes:
  94. - data:/data
  95. - /etc/timezone:/etc/timezone:ro
  96. - /etc/localtime:/etc/localtime:ro
  97. ports:
  98. - "3000:3000"
  99. - "222:22"
  100. depends_on:
  101. - db
  102. db:
  103. image: mysql:5.7
  104. restart: unless-stopped
  105. environment:
  106. - MYSQL_ROOT_PASSWORD=gitea
  107. - MYSQL_USER=gitea
  108. - MYSQL_PASSWORD=gitea
  109. - MYSQL_DATABASE=gitea
  110. networks:
  111. - gitea
  112. volumes:
  113. - mysql:/var/lib/mysql
  114. volumes:
  115. data:
  116. driver: local
  117. mysql:
  118. driver: local
  119. ```