|
|
|
FROM golang:alpine AS builder |
|
|
|
|
|
RUN apk update && apk add --no-cache \ |
|
curl \ |
|
tar \ |
|
jq |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
RUN version=$(basename $(curl -sL -o /dev/null -w %{url_effective} https://github.com/pandora-next/deploy/releases/latest)) \ |
|
&& base_url="https://github.com/pandora-next/deploy/releases/expanded_assets/$version" \ |
|
&& latest_url="https://github.com/$(curl -sL $base_url | grep "href.*amd64.*\.tar.gz" | sed 's/.*href="//' | sed 's/".*//')" \ |
|
&& curl -Lo PandoraNext.tar.gz $latest_url \ |
|
&& tar -xzf PandoraNext.tar.gz --strip-components=1 \ |
|
&& rm PandoraNext.tar.gz \ |
|
&& chmod 777 -R . |
|
|
|
|
|
RUN --mount=type=secret,id=TOKENS_JSON,dst=/etc/secrets/TOKENS_JSON \ |
|
if [ -f /etc/secrets/TOKENS_JSON ]; then \ |
|
cat /etc/secrets/TOKENS_JSON > tokens.json \ |
|
&& chmod 777 tokens.json; \ |
|
else \ |
|
echo "TOKENS_JSON not found, skipping"; \ |
|
fi |
|
|
|
|
|
RUN --mount=type=secret,id=CONFIG_JSON,dst=/etc/secrets/CONFIG_JSON \ |
|
cat /etc/secrets/CONFIG_JSON > config.json && chmod 777 config.json |
|
|
|
RUN --mount=type=secret,id=CONFIG_JSON,dst=/etc/secrets/CONFIG_JSON \ |
|
cat /etc/secrets/CONFIG_JSON |
|
|
|
|
|
RUN chmod 777 ./PandoraNext |
|
|
|
|
|
RUN mkdir /.cache && chmod 777 /.cache |
|
|
|
|
|
EXPOSE 8080 |
|
|
|
|
|
CMD ["./PandoraNext"] |