Skip to content

Commit 37e67c3

Browse files
committed
feat: updated dokcer image to rootless
1 parent 529807a commit 37e67c3

4 files changed

Lines changed: 13 additions & 6 deletions

File tree

.dockerignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ backups/
1212

1313
# Documentation (excluding LICENSE)
1414
README.md
15+
WORKFLOW.md
16+
AGENTS.md
17+
18+
# Repo metadata not needed for build context
19+
LICENSE
1520

1621
# IDE and editor files
1722
.idea/
@@ -21,4 +26,4 @@ README.md
2126

2227
# We don't need the Dockerfile itself in the build context
2328
Dockerfile
24-
.dockerignore
29+
.dockerignore

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage 1: Builder using cargo-chef for dependency caching
2-
FROM rust:1.88-slim-bookworm AS chef
2+
FROM rust:1.92-slim-bookworm AS chef
33
WORKDIR /app
44

55
# Install build dependencies
@@ -28,7 +28,7 @@ RUN cargo build --release
2828

2929
# Stage 4: Final image
3030
# Use a distroless image for a smaller and more secure final image
31-
FROM gcr.io/distroless/cc-debian12
31+
FROM gcr.io/distroless/cc-debian13:nonroot
3232
WORKDIR /app
3333

3434
# Copy the compiled binary from the builder stage
@@ -42,4 +42,4 @@ ENV LOG_CONFIG_PATH=log4rs.docker.yaml
4242

4343
# Set the entrypoint for the application
4444
# The application is responsible for creating 'logs' and 'backups' directories if they are needed.
45-
ENTRYPOINT ["./flaresync"]
45+
ENTRYPOINT ["./flaresync"]

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ FlareSync is a lightweight Rust application that automatically updates your Clou
66
- **Multiple Domain Support:** You can now specify multiple domain names to be updated. In your `.env` file, list them as a comma-separated string for the `DOMAIN_NAME` variable (e.g., `DOMAIN_NAME=example.com,sub.example.com`).
77
- **Major Refactoring:** The codebase has been significantly refactored for better readability, maintainability, and performance.
88
- **Docker-Compatible Logs:** Logging is now directed to stdout, making it easy to monitor using `docker logs`.
9-
- **Modern Toolchain:** The project now uses Rust 1.88 and has all dependencies updated to their latest versions for improved performance and security.
9+
- **Modern Toolchain:** The project now uses Rust 1.92 and has all dependencies updated to their latest versions for improved performance and security.
1010

1111

1212
## Disclaimer
@@ -18,6 +18,7 @@ This application was developed using AI. Please note that while AI tools help ac
1818
- Asynchronous operation powered by `tokio` for efficiency.
1919
- Detailed and structured logging with `log4rs`.
2020
- Dockerised for easy deployment.
21+
- For improved security, the official Docker image is distroless and runs rootless (non-root).
2122
- Backup of DNS records before updates.
2223
- Retry mechanism with exponential backoff for improved reliability.
2324

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ services:
22
flaresync:
33
image: battermanz/flaresync:latest
44
container_name: flaresync
5+
user: "1000:1000"
56
env_file:
67
- .env
78
volumes:
89
- ./backups:/app/backups
9-
restart: unless-stopped
10+
restart: unless-stopped

0 commit comments

Comments
 (0)