Created
January 29, 2024 12:56
-
-
Save lostbean/c26176813d04e525f398d62d8c8be551 to your computer and use it in GitHub Desktop.
Attic - nix cache with docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Based on https://lgug2z.com/articles/deploying-a-cloudflare-r2-backed-nix-binary-cache-attic-on-fly-io/