gitdataai/docker/gitsync.Dockerfile
2026-06-01 22:04:17 +08:00

27 lines
636 B
Docker

ARG TARGET_DIR=target
FROM ubuntu:26.04
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates libssl3 openssh-client procps git \
&& rm -rf /var/lib/apt/lists/*
RUN git config --system --add safe.directory '*'
RUN useradd -r -s /bin/false appuser
RUN mkdir -p /app/data/repos /app/logs \
&& chown -R appuser:appuser /app
COPY ${TARGET_DIR}/release/gitsync /app/gitsync
RUN chown -R appuser:appuser /app
USER appuser
WORKDIR /app
EXPOSE 8081
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8081/health || exit 1
CMD ["./gitsync"]