mirror of
https://github.com/casjaysdevdocker/gitea
synced 2026-06-24 02:01:03 -04:00
📝 Fix compose example to follow conventions 📝
- Add x-logging anchor with json-file driver
- Add pull_policy: always
- Add logging: *default-logging
- Add network block (gitea / external: false)
- Switch environment from list to map format
- Add CONTAINER_NAME to environment
- Use HOSTNAME: ${BASE_HOST_NAME:-...} pattern
- Switch volumes from absolute paths to ./volumes relative paths
- Bind ports to 172.17.0.1 (not 0.0.0.0)
- Add cgroupns_mode: private
- Add port comment at top of file
- README.md: bring compose example into line with dockerfile_conventions.md
README.md
This commit is contained in:
@@ -36,31 +36,50 @@ docker run -d \
|
|||||||
### via docker compose
|
### via docker compose
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
# nginx proxy address - http://172.17.0.1:80
|
||||||
|
|
||||||
|
x-logging: &default-logging
|
||||||
|
driver: json-file
|
||||||
|
options:
|
||||||
|
max-size: "5m"
|
||||||
|
max-file: "1"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
gitea:
|
gitea:
|
||||||
image: casjaysdevdocker/gitea:latest
|
image: casjaysdevdocker/gitea:latest
|
||||||
|
pull_policy: always
|
||||||
container_name: casjaysdevdocker-gitea-latest
|
container_name: casjaysdevdocker-gitea-latest
|
||||||
hostname: git.example.com
|
hostname: git.example.com
|
||||||
domainname: example.com
|
domainname: example.com
|
||||||
privileged: true
|
privileged: true
|
||||||
tty: true
|
tty: true
|
||||||
restart: always
|
restart: always
|
||||||
|
logging: *default-logging
|
||||||
|
cgroupns_mode: private
|
||||||
cap_add:
|
cap_add:
|
||||||
- CHOWN
|
- CHOWN
|
||||||
- SYS_TIME
|
- SYS_TIME
|
||||||
- SYS_ADMIN
|
- SYS_ADMIN
|
||||||
environment:
|
environment:
|
||||||
- TZ=America/New_York
|
TZ: ${TZ:-America/New_York}
|
||||||
- HOSTNAME=git.example.com
|
CONTAINER_NAME: casjaysdevdocker-gitea-latest
|
||||||
- GITEA_PROTO=http
|
HOSTNAME: ${BASE_HOST_NAME:-git.example.com}
|
||||||
- DATABASE_DIR_SQLITE=/data/db/sqlite
|
GITEA_PROTO: http
|
||||||
|
DATABASE_DIR_SQLITE: /data/db/sqlite
|
||||||
volumes:
|
volumes:
|
||||||
- /srv/docker/gitea/data:/data:z
|
- ./volumes/data:/data:z
|
||||||
- /srv/docker/gitea/config:/config:z
|
- ./volumes/config:/config:z
|
||||||
- /srv/docker/databases/sqlite/gitea:/data/db/sqlite:z
|
- ./volumes/db/sqlite:/data/db/sqlite:z
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- "172.17.0.1:80:80"
|
||||||
- 22:22
|
- "172.17.0.1:22:22"
|
||||||
|
networks:
|
||||||
|
- gitea
|
||||||
|
|
||||||
|
networks:
|
||||||
|
gitea:
|
||||||
|
name: gitea
|
||||||
|
external: false
|
||||||
```
|
```
|
||||||
|
|
||||||
### Environment variables
|
### Environment variables
|
||||||
|
|||||||
Reference in New Issue
Block a user