Skip to content

Commit d6ce6c7

Browse files
committed
feat: added HaRP support (Nextcloud 32+)
Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
1 parent 92a35ae commit d6ce6c7

File tree

6 files changed

+334
-4
lines changed

6 files changed

+334
-4
lines changed

Dockerfile

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,27 @@ RUN apt-get update && \
88
apt-get install -y software-properties-common && \
99
add-apt-repository -y ppa:deadsnakes/ppa && \
1010
apt-get update && \
11-
apt-get install -y --no-install-recommends python3.11 python3.11-venv python3-pip vim git && \
11+
apt-get install -y --no-install-recommends python3.11 python3.11-venv python3-pip vim git curl && \
1212
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 && \
1313
apt-get -y clean && \
1414
rm -rf /var/lib/apt/lists/*
1515

16+
# Download and install FRP client into /usr/local/bin.
17+
RUN set -ex; \
18+
ARCH=$(uname -m); \
19+
if [ "$ARCH" = "aarch64" ]; then \
20+
FRP_URL="https://raw.githubusercontent.com/nextcloud/HaRP/main/exapps_dev/frp_0.61.1_linux_arm64.tar.gz"; \
21+
else \
22+
FRP_URL="https://raw.githubusercontent.com/nextcloud/HaRP/main/exapps_dev/frp_0.61.1_linux_amd64.tar.gz"; \
23+
fi; \
24+
echo "Downloading FRP client from $FRP_URL"; \
25+
curl -L "$FRP_URL" -o /tmp/frp.tar.gz; \
26+
tar -C /tmp -xzf /tmp/frp.tar.gz; \
27+
mv /tmp/frp_0.61.1_linux_* /tmp/frp; \
28+
cp /tmp/frp/frpc /usr/local/bin/frpc; \
29+
chmod +x /usr/local/bin/frpc; \
30+
rm -rf /tmp/frp /tmp/frp.tar.gz
31+
1632
# Set working directory
1733
WORKDIR /app
1834

@@ -26,6 +42,9 @@ ENV NVIDIA_VISIBLE_DEVICES all
2642
ENV NVIDIA_DRIVER_CAPABILITIES compute
2743
ENV DEBIAN_FRONTEND dialog
2844

45+
COPY healthcheck.sh /
46+
COPY --chmod=775 start.sh /
47+
2948
# Copy application files
3049
ADD cs[s] /app/css
3150
ADD im[g] /app/img
@@ -35,6 +54,7 @@ ADD li[b] /app/lib
3554
ADD config.json /app/config.json
3655
ADD languages.json /app/languages.json
3756

38-
ENTRYPOINT ["python3", "lib/main.py"]
57+
ENTRYPOINT ["/start.sh", "python3", "lib/main.py"]
58+
HEALTHCHECK --interval=2s --timeout=2s --retries=300 CMD /healthcheck.sh
3959

4060
LABEL org.opencontainers.image.source="https://github.com/nextcloud/translate2"

0 commit comments

Comments
 (0)