feat(build): add Docker support for gitks application
- Add .dockerignore file to exclude unnecessary files from Docker build context - Create multi-stage Dockerfile with rust builder and debian runtime stages - Configure environment variables for host and port settings - Set up proper EXPOSE and ENTRYPOINT instructions - Optimize build with cargo release and binary stripping - Install only required dependencies in production stage
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
target
|
||||||
|
.git
|
||||||
|
.idea
|
||||||
|
*.md
|
||||||
|
LICENSE
|
||||||
|
.env
|
||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
FROM rust:1.96-bookworm AS builder
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN cargo build --release --bin gitks && \
|
||||||
|
strip target/release/gitks
|
||||||
|
|
||||||
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends git ca-certificates && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY --from=builder /app/target/release/gitks /usr/local/bin/gitks
|
||||||
|
|
||||||
|
ENV GITKS_HOST=0.0.0.0
|
||||||
|
ENV GITKS_PORT=50051
|
||||||
|
|
||||||
|
EXPOSE 50051
|
||||||
|
|
||||||
|
ENTRYPOINT ["gitks"]
|
||||||
Reference in New Issue
Block a user