mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
add aquatic_udp.Dockerfile
This commit is contained in:
parent
605986c402
commit
375dc1c8e6
1 changed files with 29 additions and 0 deletions
29
docker/aquatic_udp.Dockerfile
Normal file
29
docker/aquatic_udp.Dockerfile
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
# aquatic_udp
|
||||||
|
#
|
||||||
|
# Customize by setting CONFIG_FILE_CONTENTS and
|
||||||
|
# ACCESS_LIST_CONTENTS environment variables.
|
||||||
|
#
|
||||||
|
# $ 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
|
||||||
|
|
||||||
|
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 ./
|
||||||
|
|
||||||
|
# Setting config and access list file contents at runtime
|
||||||
|
RUN echo "#!/bin/sh\necho \"\$CONFIG_FILE_CONTENTS\" > ./config.toml\necho \"\$ACCESS_LIST_CONTENTS\" > ./access-list.txt\n./aquatic_udp -c ./config.toml" > entrypoint.sh && chmod +x entrypoint.sh
|
||||||
|
|
||||||
|
ENTRYPOINT ["./entrypoint.sh"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue