feat: add Dockerfile and docker-compose.yml configured for ghcr.io/exchanges-lab/nosync

This commit is contained in:
0xcathiefish
2026-05-30 10:14:54 +00:00
parent 88052a5c5b
commit f54ba537a9
2 changed files with 44 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
# Stage 1: Build dependency cache and compile application
FROM rust:1.95-bookworm AS builder
RUN apt-get update && apt-get install -y pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Create dummy source files for caching build dependencies
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && echo "fn main() {}" > src/main.rs && touch src/lib.rs
RUN cargo build --release
# Copy actual source files
COPY src ./src
# Touch files to force rebuild with real source
RUN touch src/main.rs src/lib.rs
RUN cargo build --release
# Stage 2: Minimal runtime image
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates openssl && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the built binary
COPY --from=builder /app/target/release/nosync /app/nosync
CMD ["/app/nosync"]
+15
View File
@@ -0,0 +1,15 @@
services:
nosync:
image: ghcr.io/exchanges-lab/nosync:v1.0
container_name: nosync
env_file:
- .env
volumes:
- ./data:/app/data
networks:
- cycle
restart: unless-stopped
networks:
cycle:
external: true