ws Dockerfile: use here-doc for entrypoint creation, use exec

This commit is contained in:
Joakim Frostegård 2022-07-24 11:41:46 +02:00
parent 22e3a77863
commit 2a39198692

View file

@ -1,3 +1,5 @@
# syntax=docker/dockerfile:1
# aquatic_ws
#
# WORK IN PROGRESS
@ -39,7 +41,15 @@ WORKDIR /root/
COPY --from=builder /usr/src/aquatic/target/release/aquatic_ws ./
# Enable 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_ws -P -c ./config.toml" > entrypoint.sh && chmod +x entrypoint.sh
# Create entry point script for setting config and access
# 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_ws -P -c ./config.toml
EOT
RUN chmod +x ./entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]