Update Dockerfile
Browse files- Dockerfile +8 -15
Dockerfile
CHANGED
|
@@ -19,22 +19,18 @@ RUN version=$(basename $(curl -sL -o /dev/null -w %{url_effective} https://githu
|
|
| 19 |
&& rm PandoraNext.tar.gz \
|
| 20 |
&& chmod 777 -R .
|
| 21 |
|
| 22 |
-
#
|
| 23 |
RUN --mount=type=secret,id=TOKENS_JSON,dst=/etc/secrets/TOKENS_JSON \
|
| 24 |
if [ -f /etc/secrets/TOKENS_JSON ]; then \
|
| 25 |
-
cat /etc/secrets/TOKENS_JSON > tokens.json
|
| 26 |
-
chmod 777 tokens.json; \
|
| 27 |
else \
|
| 28 |
echo "TOKENS_JSON not found, skipping"; \
|
| 29 |
fi
|
| 30 |
|
|
|
|
| 31 |
RUN --mount=type=secret,id=CONFIG_JSON,dst=/etc/secrets/CONFIG_JSON \
|
| 32 |
-
|
| 33 |
-
cat /etc/secrets/CONFIG_JSON > config.json && \
|
| 34 |
-
chmod 777 config.json; \
|
| 35 |
-
else \
|
| 36 |
-
echo "CONFIG_JSON not found, skipping"; \
|
| 37 |
-
fi
|
| 38 |
|
| 39 |
# Modify the execution permissions of PandoraNext
|
| 40 |
RUN chmod 777 ./PandoraNext
|
|
@@ -42,12 +38,9 @@ RUN chmod 777 ./PandoraNext
|
|
| 42 |
# Create a global cache directory and provide the most lenient permissions
|
| 43 |
RUN mkdir /.cache && chmod 777 /.cache
|
| 44 |
|
| 45 |
-
# Copy the restart script into the container and make it executable
|
| 46 |
-
COPY restart.sh /app/restart.sh
|
| 47 |
-
RUN chmod +x /app/restart.sh
|
| 48 |
-
|
| 49 |
# Open port
|
| 50 |
EXPOSE 8181
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
|
|
|
|
|
| 19 |
&& rm PandoraNext.tar.gz \
|
| 20 |
&& chmod 777 -R .
|
| 21 |
|
| 22 |
+
# Get tokens.json
|
| 23 |
RUN --mount=type=secret,id=TOKENS_JSON,dst=/etc/secrets/TOKENS_JSON \
|
| 24 |
if [ -f /etc/secrets/TOKENS_JSON ]; then \
|
| 25 |
+
cat /etc/secrets/TOKENS_JSON > tokens.json \
|
| 26 |
+
&& chmod 777 tokens.json; \
|
| 27 |
else \
|
| 28 |
echo "TOKENS_JSON not found, skipping"; \
|
| 29 |
fi
|
| 30 |
|
| 31 |
+
# Get config.json
|
| 32 |
RUN --mount=type=secret,id=CONFIG_JSON,dst=/etc/secrets/CONFIG_JSON \
|
| 33 |
+
cat /etc/secrets/CONFIG_JSON > config.json && chmod 777 config.json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
# Modify the execution permissions of PandoraNext
|
| 36 |
RUN chmod 777 ./PandoraNext
|
|
|
|
| 38 |
# Create a global cache directory and provide the most lenient permissions
|
| 39 |
RUN mkdir /.cache && chmod 777 /.cache
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
# Open port
|
| 42 |
EXPOSE 8181
|
| 43 |
|
| 44 |
+
|
| 45 |
+
# Start command with a loop for automatic restart
|
| 46 |
+
CMD ["sh", "-c", "while true; do ./PandoraNext; sleep 3600; done"]
|