fp/apps/aquatic/docker/aquatic_udp.Dockerfile
CJ_Clippy 694dc89f03 git subrepo clone https://github.com/greatest-ape/aquatic ./apps/aquatic
subrepo:
  subdir:   "apps/aquatic"
  merged:   "34b45e92"
upstream:
  origin:   "https://github.com/greatest-ape/aquatic"
  branch:   "master"
  commit:   "34b45e92"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2025-02-21 19:47:41 -08:00

49 lines
1.3 KiB
Docker

# syntax=docker/dockerfile:1
# aquatic_udp
#
# Please note that running aquatic_udp under Docker is NOT RECOMMENDED due to
# suboptimal performance. This file is provided as a starting point for those
# who still wish to do so.
#
# Customize by setting CONFIG_FILE_CONTENTS and
# ACCESS_LIST_CONTENTS environment variables.
#
# By default runs tracker on port 3000 without info hash access control.
#
# Run from repository root directory with:
# $ DOCKER_BUILDKIT=1 docker build -t aquatic-udp -f docker/aquatic_udp.Dockerfile .
# $ docker run -it -p 0.0.0.0:3000:3000/udp --name aquatic-udp aquatic-udp
#
# Pass --network="host" to run command for much better performance.
FROM rust:latest AS builder
WORKDIR /usr/src/aquatic
COPY . .
RUN . ./scripts/env-native-cpu-without-avx-512 && cargo build --release -p aquatic_udp
FROM debian:stable-slim
ENV CONFIG_FILE_CONTENTS "log_level = 'warn'"
ENV ACCESS_LIST_CONTENTS ""
WORKDIR /root/
COPY --from=builder /usr/src/aquatic/target/release/aquatic_udp ./
# Create entry point script for setting config and access
# list file contents at runtime
COPY <<-"EOT" ./entrypoint.sh
#!/bin/bash
echo -e "$CONFIG_FILE_CONTENTS" > ./config.toml
echo -e "$ACCESS_LIST_CONTENTS" > ./access-list.txt
exec ./aquatic_udp -c ./config.toml "$@"
EOT
RUN chmod +x ./entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]