mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
udp Dockerfile: use here-doc for entrypoint creation
This commit is contained in:
parent
2a39198692
commit
bd70474d73
1 changed files with 15 additions and 2 deletions
|
|
@ -1,8 +1,13 @@
|
||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
# aquatic_udp
|
# aquatic_udp
|
||||||
#
|
#
|
||||||
# Customize by setting CONFIG_FILE_CONTENTS and
|
# Customize by setting CONFIG_FILE_CONTENTS and
|
||||||
# ACCESS_LIST_CONTENTS environment variables.
|
# ACCESS_LIST_CONTENTS environment variables.
|
||||||
#
|
#
|
||||||
|
# By default runs tracker on port 3000 without info hash access control.
|
||||||
|
#
|
||||||
|
# Run from repository root directory with:
|
||||||
# $ docker build -t aquatic-udp -f docker/aquatic_udp.Dockerfile .
|
# $ 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
|
# $ docker run -it -p 0.0.0.0:3000:3000/udp --name aquatic-udp aquatic-udp
|
||||||
|
|
||||||
|
|
@ -23,7 +28,15 @@ WORKDIR /root/
|
||||||
|
|
||||||
COPY --from=builder /usr/src/aquatic/target/release/aquatic_udp ./
|
COPY --from=builder /usr/src/aquatic/target/release/aquatic_udp ./
|
||||||
|
|
||||||
# Setting config and access list file contents at runtime
|
# Create entry point script for setting config and access
|
||||||
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
|
# list file contents at runtime
|
||||||
|
COPY <<-"EOT" ./entrypoint.sh
|
||||||
|
#!/bin/sh
|
||||||
|
echo "$CONFIG_FILE_CONTENTS" > ./config.toml
|
||||||
|
echo "$ACCESS_LIST_CONTENTS" > ./access-list.txt
|
||||||
|
exec ./aquatic_udp -P -c ./config.toml
|
||||||
|
EOT
|
||||||
|
|
||||||
|
RUN chmod +x ./entrypoint.sh
|
||||||
|
|
||||||
ENTRYPOINT ["./entrypoint.sh"]
|
ENTRYPOINT ["./entrypoint.sh"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue