56 lines
1.8 KiB
Docker
56 lines
1.8 KiB
Docker
# syntax=docker/dockerfile:1
|
|
FROM debian:stable-slim AS release
|
|
ENV PATH=/command:$PATH
|
|
|
|
RUN apt-get update -qq \
|
|
&& apt-get install -y -qq --no-install-recommends \
|
|
xz-utils \
|
|
unzip \
|
|
ca-certificates \
|
|
curl \
|
|
&& export BUN_INSTALL=/home/bun \
|
|
&& curl -fsSL https://bun.sh/install | bash -s "bun-v1.2.2" \
|
|
&& groupadd bun \
|
|
&& useradd bun \
|
|
--gid bun \
|
|
--shell /bin/sh \
|
|
--create-home \
|
|
&& apt-get clean \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& chown -R bun:bun /home/bun
|
|
|
|
|
|
# copy tracker-helper app
|
|
COPY --from=gitea.futureporn.net/futureporn/tracker-helper:latest /usr/src/app/node_modules /usr/src/tracker-helper/node_modules
|
|
COPY --from=gitea.futureporn.net/futureporn/tracker-helper:latest /usr/src/app/index.ts /usr/src/tracker-helper/
|
|
COPY --from=gitea.futureporn.net/futureporn/tracker-helper:latest /usr/src/app/app.ts /usr/src/tracker-helper/
|
|
COPY --from=gitea.futureporn.net/futureporn/tracker-helper:latest /usr/src/app/package.json /usr/src/tracker-helper/
|
|
|
|
# copy aquatic app
|
|
COPY --from=gitea.futureporn.net/futureporn/aquatic:latest /usr/local/bin/aquatic_udp /usr/local/bin/aquatic_udp
|
|
|
|
# copy caddy
|
|
COPY --from=caddy:alpine /usr/bin/caddy /usr/bin/caddy
|
|
|
|
# copy our app (s6-overlay dir structure)
|
|
COPY ./root /
|
|
|
|
|
|
# 9000/tcp for aquatic_udp metrics /metrics
|
|
# and tracker-helper api /helper/*
|
|
# Caddy handles the routing for us
|
|
EXPOSE 9000/tcp
|
|
|
|
# 6969/udp for aquatic_udp
|
|
EXPOSE 6969/udp
|
|
|
|
|
|
HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
|
|
CMD /etc/tracker/healthcheck.sh
|
|
|
|
|
|
ADD https://github.com/just-containers/s6-overlay/releases/download/v3.2.0.2/s6-overlay-noarch.tar.xz /tmp
|
|
RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz
|
|
ADD https://github.com/just-containers/s6-overlay/releases/download/v3.2.0.2/s6-overlay-x86_64.tar.xz /tmp
|
|
RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz
|
|
ENTRYPOINT ["/init"] |