Last modified by Alexandru Pentilescu on 2024/07/16 22:44

From version 3.1
edited by Alexandru Pentilescu
on 2024/07/16 21:11
Change comment: There is no comment for this version
To version 5.1
edited by Alexandru Pentilescu
on 2024/07/16 21:18
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,6 +1,9 @@
1 -{{box cssClass="floatinginfobox" title="**Contents**"}}{{toc /}}{{/box}}
1 +{{box cssClass="floatinginfobox" title="**Contents**"}}
2 +{{toc /}}
3 +{{/box}}
2 2  
3 3  = Basic installation =
6 +
4 4  To setup a gitea server using docker, the following docker-compose.yml file shall be used:
5 5  
6 6  {{code language="yaml"}}
... ... @@ -49,12 +49,11 @@
49 49  
50 50  Do a simple command to create the necessary directories:
51 51  
52 -{{code language="bash"}}
53 -mkdir data db
54 -{{/code}}
55 +{{code language="bash"}}mkdir data db{{/code}}
55 55  Backing up just these two directories should, in theory, be enough to allow for full restoration of all git repository resources into the future. **WARNING: This has not been tested yet!!!**
56 56  
57 57  = Create a separate git user to login into via SSH =
59 +
58 58  Creating a separate user, technically, is unnecessary, but it makes the configuration more conventional.
59 59  
60 60  {{code language="bash"}}
... ... @@ -69,3 +69,39 @@
69 69  chown git:git -R /home/git/.ssh/
70 70  chmod 700 /home/git/.ssh/
71 71  {{/code}}
74 +
75 +Once all these steps are done, you can proceed to the next step.
76 +
77 += Spin up a container from the docker image =
78 +
79 +{{code language="bash"}}
80 +docker-compose up -d
81 +{{/code}}
82 +
83 +Had all the necessary steps been done properly, this should yield a fully functional container. If there are any errors encountered by this point, please fix them before proceeding.
84 +
85 += Set up a proper nginx endpoint for the docker service =
86 +
87 +Deploy the following configuration to make the container accessible to the outside world:
88 +
89 +{{code language="nginx"}}
90 +server {
91 + server_name git.transistor.one;
92 +
93 + listen [::]:443 http2 ssl; # managed by Certbot
94 + listen 443 http2 ssl; # managed by Certbot
95 + # http2 on;
96 +
97 + include /etc/nginx/snippets/ssl.conf;
98 +
99 + location / {
100 + proxy_pass http://localhost:3000;
101 + }
102 +}
103 +{{/code}}
104 +
105 +Once this is done, restart nginx:
106 +
107 +{{code language="bash"}}
108 +systemctl restart nginx
109 +{{/code}}