Skip to content

Commit

Permalink
Add docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewmeyer committed Oct 8, 2024
1 parent a821c3c commit eb6c6b3
Show file tree
Hide file tree
Showing 3 changed files with 128 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
.gitignore
Dockerfile
README.md
.github
ddrs
coverage.lcov
coverage.out
.git

### dotenv ###
.env

### Rust ###
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*


# Added by cargo

/target
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM rust:1.81.0-alpine AS base
RUN apk add musl-dev musl-utils
RUN cargo install cargo-chef

FROM base AS chef
COPY . .
RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder
COPY --from=chef /recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN cargo build --target x86_64-unknown-linux-musl --release --bin ddrs

FROM scratch AS runtime
COPY --from=builder /target/x86_64-unknown-linux-musl/release/ddrs /bin/
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
CMD ["/bin/ddrs"]
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
cloudflare-ddrs:
image: ddrs:latest
container_name: ddrs
network_mode: "host"
restart: always
volumes:
- ./config.toml:/etc/ddrs/config.toml

0 comments on commit eb6c6b3

Please sign in to comment.