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.

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