Skip to content

Instantly share code, notes, and snippets.

@lostbean
Created January 29, 2024 12:56
Show Gist options
  • Save lostbean/c26176813d04e525f398d62d8c8be551 to your computer and use it in GitHub Desktop.
Save lostbean/c26176813d04e525f398d62d8c8be551 to your computer and use it in GitHub Desktop.
Attic - nix cache with docker
FROM ghcr.io/zhaofengli/attic:latest
COPY ./attic.toml /attic/server.toml
RUN mkdir -p /cache
RUN mkdir -p /data
EXPOSE 8080
CMD ["-f", "/attic/server.toml", "--mode", "monolithic"]
listen = "[::]:8080"
# generate this with: openssl rand 64 | base64 -w0
token-hs256-secret-base64 = "<TOKEN>"
[storage]
type = "local"
path = "/cache"
[database]
url = "sqlite:///data/attic.db?mode=rwc"
[chunking]
nar-size-threshold = 65536
min-size = 16384
avg-size = 65536
max-size = 262144
[compression]
type = "zstd"
[garbage-collection]
interval = "12 hours"
services:
attic:
image: attic
build:
context: .
dockerfile: attic.Dockerfile
ports:
- 8080:8080
volumes:
- /attic/data:/data
- /attic/cache:/cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment