-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (31 loc) · 958 Bytes
/
Dockerfile
File metadata and controls
44 lines (31 loc) · 958 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Build stage
FROM rust:latest AS builder
WORKDIR /app
# Copy manifests
COPY Cargo.toml Cargo.lock ./
# Copy source code
COPY src ./src
# Build the application in release mode
RUN cargo build --release
# Runtime stage
FROM debian:bookworm-slim
# Install necessary runtime dependencies
RUN apt-get update && \
apt-get install -y ca-certificates gosu && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the binary from builder
COPY --from=builder /app/target/release/crooner /usr/local/bin/crooner
# Create directory for backup
RUN mkdir -p /backup
# Copy default config (will be overridden by volume mount)
COPY config.toml /app/config.toml
# Create non-root user and docker group
RUN groupadd -g 999 docker && \
useradd -m -u 1000 -G docker crooner && \
chown -R crooner:crooner /app /backup
# Copy and setup entrypoint
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["crooner"]