Skip to content

Commit c9ad64a

Browse files
committed
ci: 💚 reorganize dockerfile
1 parent 170dadd commit c9ad64a

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

Dockerfile

+5-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN mkdir ./src && echo 'fn main() { panic!("Dummy Image Called!")}' > ./src/mai
99
RUN cargo build --release
1010

1111
# Copy source files over
12-
RUN rm -rf ./src && rm -rf ./target/release
12+
RUN rm -rf ./src
1313
COPY ./src ./src
1414

1515
# The last modified attribute of main.rs needs to be updated manually,
@@ -22,7 +22,8 @@ FROM debian:stable-slim
2222
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates zstd && \
2323
apt-get clean && \
2424
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
25-
COPY --from=rust-builder /build/target/release/s-backup /usr/local/bin/
26-
WORKDIR /usr/local/bin
27-
CMD ["s-backup"]
25+
COPY --from=rust-builder /build/target/release/s-backup /app/
26+
ENV TZ=Etc/UTC
27+
WORKDIR /app
28+
ENTRYPOINT ["/app/s-backup"]
2829

config.example.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ region = "region_name"
66
secret_access_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
77

88
[[backup]]
9-
exclude = ["data"]
9+
exclude = ["exclude", "data"]
1010
name = "test"
1111
path = "../test-rust"
1212
interval = 86400
13+
keep = 5
1314

1415
[[backup]]
15-
exclude = ["data"]
16+
exclude = ["exclude", "data"]
1617
name = "test2"
1718
path = "../test-rust"
1819
interval = 43200

docker-compose.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ services:
55
image: s-backup:latest
66
restart: unless-stopped
77
environment:
8-
RUST_LOG: "info"
8+
- TZ=Etc/UTC
99
volumes:
10-
- ./data:/data
10+
- ./config.toml:/app/config.toml
11+
- /path/to/backup:/backup_path_in_config:ro
12+
command: [run, --config, ./config.toml]

0 commit comments

Comments
 (0)