mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-02 06:56:36 +08:00
chore(agent): move docker entrypoint script to scripts/
Relocate agent-entrypoint.sh from docker/ to scripts/ so operational shell scripts live in one directory and update Dockerfile.agent copy path.
This commit is contained in:
@@ -38,7 +38,7 @@ ENV OPENFLARE_OPENRESTY_PATH=openresty \
|
||||
OPENFLARE_DATA_DIR=/data
|
||||
|
||||
COPY --from=builder /build/bin/openflare-agent /usr/local/bin/openflare-agent
|
||||
COPY docker/agent-entrypoint.sh /usr/local/bin/openflare-agent-entrypoint.sh
|
||||
COPY scripts/agent-entrypoint.sh /usr/local/bin/openflare-agent-entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/openflare-agent-entrypoint.sh
|
||||
|
||||
EXPOSE 80 443 18081
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
RUNTIME_USER="openflare"
|
||||
AGENT_BIN="/usr/local/bin/openflare-agent"
|
||||
OPENRESTY_BIN="/usr/local/openresty/nginx/sbin/nginx"
|
||||
|
||||
fix_runtime_ownership() {
|
||||
for target in /data /etc/openflare; do
|
||||
if [ -d "$target" ]; then
|
||||
chown -R "${RUNTIME_USER}:${RUNTIME_USER}" "$target" 2>/dev/null || true
|
||||
chmod -R u+rwX,g+rX "$target" 2>/dev/null || true
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
fix_runtime_ownership
|
||||
exec su-exec "${RUNTIME_USER}" "${AGENT_BIN}" "$@"
|
||||
fi
|
||||
|
||||
exec "${AGENT_BIN}" "$@"
|
||||
Reference in New Issue
Block a user