Repository navigation
Expand file tree
/
Copy pathcompose.yaml
More file actions
69 lines (60 loc) · 2.41 KB
/
Copy pathcompose.yaml
File metadata and controls
69 lines (60 loc) · 2.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: forgejo
x-daemonless:
title: "Forgejo"
icon: ":simple-forgejo:"
category: "Infrastructure"
description: "Forgejo is a self-hosted lightweight software forge"
upstream_url: "https://codeberg.org/forgejo/forgejo"
web_url: "https://forgejo.org/"
freshports_url: "https://www.freshports.org/www/forgejo/"
user: "bsd"
mlock: false
upstream_binary: false
docs:
env:
PUID: "User ID for the application process"
PGID: "Group ID for the application process"
TZ: "Timezone for the container"
SSH_PORT: "Published port for sshd (used in clone URLs)"
SSH_LISTEN_PORT: "Port on which sshd listens inside the container"
volumes:
/config: "Configuration, repositories, and data directory"
ports:
3000: "Web UI"
22: "SSH port"
notes: |
## First run
If no configuration file exists when the container starts, it will generate an initial default
config file at `/config/custom/conf/app.ini`.
You can make configuration changes in this file later (e.g. SMTP configuration) and they will be
preserved across container restarts.
## SSH Setup
If you modify the port mapping from the default `2222:22` you need to update the 2 environment variables
described below accordingly.
### `SSH_LISTEN_PORT` env var
This variable indicates on which port Forgejo's ssh server listens inside the container.
If your port mapping for ssh is `2222:22`, this variable should be set to `22`.
This variable is used on every container start to modify the `sshd_config` config file.
### `SSH_PORT` env var
This variable tells Forgejo on which port the ssh server is reachable from the outside and is
used when constructing the `ssh` URLs shown in Forgejo's web UI.
If your port mapping for ssh is `2222:22`, this variable should be set to `2222`.
This variable is used only during the first container startup to create the initial configuration file for Forgejo.
If you want to modify the `SSH_PORT` later, you need to change the configuration in the `[server]`
section of `/config/custom/conf/app.ini`.
services:
forgejo:
image: ghcr.io/daemonless/forgejo:15
container_name: forgejo
restart: always
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- SSH_PORT=2222
- SSH_LISTEN_PORT=22
volumes:
- /path/to/containers/forgejo:/config
ports:
- "3000:3000"
- "2222:22"