Wiki source code of How to set up a gitea docker instance
Version 2.1 by Alexandru Pentilescu on 2024/07/16 20:56
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{box cssClass="floatinginfobox" title="**Contents**"}}{{toc /}}{{/box}} | ||
2 | |||
3 | = Basic installation = | ||
4 | To setup a gitea server using docker, the following docker-compose.yml file shall be used: | ||
5 | |||
6 | {{code language="yaml"}} | ||
7 | version: '2' | ||
8 | |||
9 | networks: | ||
10 | gitea: | ||
11 | external: false | ||
12 | |||
13 | services: | ||
14 | web: | ||
15 | image: gitea/gitea:latest | ||
16 | environment: | ||
17 | - USER_UID=1002 | ||
18 | - USER_GID=1002 | ||
19 | volumes: | ||
20 | - ./data:/data | ||
21 | - /home/git/.ssh/:/data/git/.ssh | ||
22 | ports: | ||
23 | - "3000:3000" | ||
24 | - "2200:22" | ||
25 | depends_on: | ||
26 | - db | ||
27 | restart: always | ||
28 | networks: | ||
29 | - gitea | ||
30 | db: | ||
31 | image: mariadb | ||
32 | restart: always | ||
33 | environment: | ||
34 | - MYSQL_ROOT_PASSWORD=<redacted> | ||
35 | - MYSQL_DATABASE=gitea | ||
36 | - MYSQL_USER=gitea | ||
37 | - MYSQL_PASSWORD=<redacted> | ||
38 | volumes: | ||
39 | - ./db/:/var/lib/mysql | ||
40 | networks: | ||
41 | - gitea | ||
42 | {{/code}} |