Clean up
This commit is contained in:
parent
3f60b72c3b
commit
b414c05400
18 changed files with 905 additions and 985 deletions
19
Dockerfile
19
Dockerfile
|
|
@ -7,39 +7,24 @@ WORKDIR /app
|
|||
COPY Cargo.toml Cargo.lock ./
|
||||
COPY src ./src
|
||||
|
||||
# Build the application
|
||||
RUN cargo build --release
|
||||
|
||||
# Runtime stage
|
||||
FROM alpine:latest
|
||||
FROM alpine:3.21
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apk add --no-cache \
|
||||
ca-certificates \
|
||||
tzdata \
|
||||
curl
|
||||
RUN apk add --no-cache ca-certificates tzdata curl
|
||||
|
||||
# Create non-root user
|
||||
RUN addgroup -g 1000 updater && \
|
||||
adduser -u 1000 -G updater -s /bin/sh -D updater
|
||||
|
||||
# Create necessary directories
|
||||
RUN mkdir -p /app/config && \
|
||||
chown -R updater:updater /app
|
||||
|
||||
# Copy binary from builder stage
|
||||
COPY --from=builder /app/target/release/docker-compose-updater /usr/local/bin/docker-compose-updater
|
||||
|
||||
# Switch to non-root user
|
||||
USER updater
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Expose health check port
|
||||
EXPOSE 8080
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:8080/health || exit 1
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue