27 lines
671 B
Docker
27 lines
671 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/data/files /app/data/avatar /app/logs \
|
|
&& chown -R appuser:appuser /app
|
|
|
|
COPY ${TARGET_DIR}/release/gitdata /app/gitdata
|
|
RUN chown -R appuser:appuser /app
|
|
|
|
USER appuser
|
|
WORKDIR /app
|
|
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
|
|
CMD curl -f http://localhost:8080/metrics || exit 1
|
|
|
|
CMD ["./gitdata"]
|