Move config to /mnt/workspace for persistence
Browse files- Dockerfile +5 -3
- entrypoint.sh +6 -0
Dockerfile
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
-
# Updated: 2026-04-26 14:41 UTC
|
| 2 |
FROM ghcr.io/cjackhwang/ds2api:latest
|
| 3 |
-
COPY config.json /app/config.json
|
| 4 |
ENV PORT=7860
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
EXPOSE 7860
|
| 6 |
-
|
|
|
|
|
|
|
| 1 |
FROM ghcr.io/cjackhwang/ds2api:latest
|
|
|
|
| 2 |
ENV PORT=7860
|
| 3 |
+
ENV CONFIG_PATH=/mnt/workspace/config.json
|
| 4 |
+
COPY config.json /tmp/config.json
|
| 5 |
+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
| 6 |
+
RUN chmod +x /usr/local/bin/entrypoint.sh
|
| 7 |
EXPOSE 7860
|
| 8 |
+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
entrypoint.sh
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
if [ ! -f /mnt/workspace/config.json ]; then
|
| 3 |
+
cp /tmp/config.json /mnt/workspace/config.json
|
| 4 |
+
echo "Initialized config.json from defaults"
|
| 5 |
+
fi
|
| 6 |
+
exec /usr/local/bin/ds2api
|