Add Gitea entrypoint to generate app.ini from template on startup
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 6s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 6s
Since app.ini is gitignored, the container needs to create it at runtime. The entrypoint copies the template on first start, then Gitea's env var overrides handle secrets. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -152,6 +152,7 @@ services:
|
|||||||
gitea:
|
gitea:
|
||||||
image: docker.gitea.com/gitea:1.25.4-rootless
|
image: docker.gitea.com/gitea:1.25.4-rootless
|
||||||
container_name: "${GITEA_HOST}"
|
container_name: "${GITEA_HOST}"
|
||||||
|
entrypoint: ["/usr/bin/dumb-init", "--", "/etc/gitea/entrypoint.sh"]
|
||||||
networks:
|
networks:
|
||||||
- app-network
|
- app-network
|
||||||
environment:
|
environment:
|
||||||
@@ -169,6 +170,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./gitea/data:/var/lib/gitea
|
- ./gitea/data:/var/lib/gitea
|
||||||
- ./gitea/config:/etc/gitea
|
- ./gitea/config:/etc/gitea
|
||||||
|
- ./gitea/entrypoint.sh:/etc/gitea/entrypoint.sh:ro
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
10
gitea/entrypoint.sh
Executable file
10
gitea/entrypoint.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Generate app.ini from template if it doesn't already exist
|
||||||
|
if [ ! -f /etc/gitea/app.ini ]; then
|
||||||
|
cp /etc/gitea/app.ini.template /etc/gitea/app.ini
|
||||||
|
echo "Generated app.ini from template"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec /usr/local/bin/docker-entrypoint.sh "$@"
|
||||||
Reference in New Issue
Block a user