Update start-container.sh
Browse files- start-container.sh +18 -8
start-container.sh
CHANGED
|
@@ -13,16 +13,26 @@ sleep 2
|
|
| 13 |
kill -0 "${PROXY_PID}" 2>/dev/null || die "Proxy murió al arrancar."
|
| 14 |
log "Proxy activo en :7860 ✓"
|
| 15 |
|
| 16 |
-
# PASO 2 —
|
| 17 |
-
log "PASO 2:
|
| 18 |
-
mkdir -p /data/gitea
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
chown -R git:git /data
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
GITEA_PID=$!
|
| 22 |
log "Gitea lanzado con PID ${GITEA_PID}"
|
| 23 |
|
| 24 |
-
# PASO
|
| 25 |
-
log "PASO
|
| 26 |
attempt=0
|
| 27 |
while true; do
|
| 28 |
curl -sSf --max-time 3 http://localhost:3000 >/dev/null 2>&1 && break
|
|
@@ -33,7 +43,7 @@ while true; do
|
|
| 33 |
done
|
| 34 |
log "✓ Gitea listo"
|
| 35 |
|
| 36 |
-
# PASO
|
| 37 |
-
log "PASO
|
| 38 |
wait "${PROXY_PID}"
|
| 39 |
exit $?
|
|
|
|
| 13 |
kill -0 "${PROXY_PID}" 2>/dev/null || die "Proxy murió al arrancar."
|
| 14 |
log "Proxy activo en :7860 ✓"
|
| 15 |
|
| 16 |
+
# PASO 2 — Asegurar permisos
|
| 17 |
+
log "PASO 2: Verificando permisos..."
|
| 18 |
+
mkdir -p /data/gitea/conf \
|
| 19 |
+
/data/gitea/data \
|
| 20 |
+
/data/gitea/log \
|
| 21 |
+
/data/gitea/repositories \
|
| 22 |
+
/data/gitea/indexers \
|
| 23 |
+
/data/ssh
|
| 24 |
chown -R git:git /data
|
| 25 |
+
chmod -R 755 /data
|
| 26 |
+
log "Permisos OK ✓"
|
| 27 |
+
|
| 28 |
+
# PASO 3 — Arrancar Gitea
|
| 29 |
+
log "PASO 3: Arrancando Gitea como usuario git..."
|
| 30 |
+
su git -c "gitea web --config /data/gitea/conf/app.ini" &
|
| 31 |
GITEA_PID=$!
|
| 32 |
log "Gitea lanzado con PID ${GITEA_PID}"
|
| 33 |
|
| 34 |
+
# PASO 4 — Health check
|
| 35 |
+
log "PASO 4: Esperando Gitea en :3000..."
|
| 36 |
attempt=0
|
| 37 |
while true; do
|
| 38 |
curl -sSf --max-time 3 http://localhost:3000 >/dev/null 2>&1 && break
|
|
|
|
| 43 |
done
|
| 44 |
log "✓ Gitea listo"
|
| 45 |
|
| 46 |
+
# PASO 5 — Mantener container vivo
|
| 47 |
+
log "PASO 5: Container vivo via proxy PID ${PROXY_PID}"
|
| 48 |
wait "${PROXY_PID}"
|
| 49 |
exit $?
|